SortingAnimated
Quick Sort
Partition around a pivot, then sort each side.
Time
O(n log n) avg, O(n²) worst
Extra space
O(log n)
Use it for
General-purpose in-memory sorting.
How it works
- Choose a pivot (here the last item).
- Partition: move smaller items to its left and larger to its right.
- The pivot is now in its final position.
- Recursively sort the left and right parts. Average O(n log n); worst O(n²) with bad pivots.
Watch it run
Loading animation…