DSA · Reimagined
Sorting medium time O(n log n) avg space O(log n)

Quick Sort

Pick a pivot (here the last element). Move everything smaller to its left and larger to its right, so the pivot lands in its final spot. Then sort each side the same way.

7
0
2
1
9
2
1
3
6
4
3
5
8
6
5
7

Quick sort: partition around a pivot, then recurse on each side.

1 / 32

Practice

Machine twin: /dsa-viz-v2/quick-sort.json — the full deterministic run as structured data.