Randomised quick sort
Quick sort with its pivot picked at random. In each part, pick a place at random, swap its number to the end, and split the part round it as quick sort does. Averaged over the picks, a row already in order, quick sort's worst case, costs the same as any other order of its numbers.
- comparisons
- 0
- swaps
- 0
step 1 of 1
Examples