C- quicksort in-place and non-recursive

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DarkArchon
    New Member
    • Mar 2008
    • 11

    C- quicksort in-place and non-recursive

    I've been looking online for C code for a quicksort that is both in-place and non-recursive. There are example of each but does anyone have a link to code that is both?
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Er, I think non-recursive and in-place are mutually exclusive. I mean, doesn't in-place mean non-calling-anything?

    Comment

    • DarkArchon
      New Member
      • Mar 2008
      • 11

      #3
      In place means that the list is not copied in to subsequent sublists, but rather swapped around

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by DarkArchon
        In place means that the list is not copied in to subsequent sublists, but rather swapped around
        If you're interested in a nice big-Oh-wise stable in-place non-recursive sorting
        algorithm check the heap sort algorithm. It has O(n*log(n)) performance just
        like the quick sort algorithm.

        kind regards,

        Jos

        Comment

        • weaknessforcats
          Recognized Expert Expert
          • Mar 2007
          • 9214

          #5
          Originally posted by DarkArchon
          In place means that the list is not copied in to subsequent sublists, but rather swapped around
          Of course. I must have been confused by in-line.

          I need more coffee.

          Comment

          Working...