Quick sort
mediumAfter 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 placeLoading the quick sort engine…