Expected Time
Average over the algorithm's own random choices, for any input.
Decision · step 2 of 56More Sorts: Same input, another seed, another path
Indices 0 to 11, depth 0. The seed picks index 11, holding 12, as the pivot.
What you will see
Randomized quick sort on the same adversarial input, many seeds; the depth distribution.
Cost
| Space | O(1) |
|---|
How you work with it here
explore, compare two runs, run it on your own input.
Screen readers: Growth curves are described in words and as a table of operation counts for sample input sizes; each concept has a one-sentence spoken definition.
Reduced motion: Curves and counters update without animation.
Before this
Taught by the same lesson
More Sorts covers these too, in the same run.