AlgoScope

Partition

AlgorithmintermediateArray Techniques

Push everything smaller than the pivot to its left, then drop the pivot between the groups.

Decision · step 3 of 29Quick Sort: Seven values
range 0-650114223843576jipivot5 < 7

5 is smaller than the pivot 7, so it belongs on the left.

Open in the player →or start at step 3

What you will see

The pivot is pinned; a boundary pointer grows the "smaller" region with each swap.

How quick sort works →

Cost

BestO(n)
AverageO(n)
WorstO(n)
SpaceO(1)

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input, predict what happens next.

Screen readers: Each cell is announced as index, value and state; each step's accessibility text states the decision and its effect.

Reduced motion: Swaps and shifts become value crossfades with an outline flash; pointers appear at their destination.

Before this

Variants

  • Lomuto Partition Single scan with a boundary index.
  • Hoare Partition Two pointers converge from both ends.

Leads to

Topics that need this one first.

Taught by the same lesson

Quick Sort covers these too, in the same run.