Explanation

Start at opposites sides of the segment of array we'd like to partition.

Move left pointer inwards as long as elements are less than pivot.

Move right pointer inwards as long as elements are greater than pivot.

Swap elements under left and right pointers and repeat.


next up previous
Next: Picking A Pivot Up: DIVIDE-AND-CONQUER SORTING Previous: Partitioning In Place