Quick sort
Quick sort · O(n log n)
Elements Active CompletePlayed 0.0 s · same input
Quick sort
Quick sortOperations0
Comparisons0
Writes0
Each comparison or write counts as 1 operation. Playback time is not execution time.
← Back to six-algorithm comparisonHow it works +
Uses the last element as pivot, moves smaller values left and processes both sides recursively. Average time is O(n log n), worst case O(n²); worst-case recursion space is O(n).
Extra space: O(log n) on average; Unstable. Each comparison or main-array write counts as 1 operation.