Quick sort

medium

After one partition the pivot is in its final position forever. Choose 'last element' and feed it a sorted array to watch the O(n²) worst case unfold, then switch to median-of-three and watch it disappear.

Best O(n log n)Average O(n log n)Worst O(n²)Space O(log n) stackNot stableIn place
Loading the quick sort engine…

Where to go next