Sorting
See why the clever sorts beat the obvious ones.
Sorting progress0 / 8
- Sorting BasicsComparisons, swaps, stability: the vocabulary of order.4m
- Bubble SortSwap neighbours until the big values float to the end.4m
- Selection SortFind the smallest, put it in front, then do it again.4m
- Insertion SortBuild a sorted run, slide each newcomer into place.5m
- Merge SortSplit until trivial, then merge your way back up.6m
- Quick SortPick a pivot, split around it, and never merge.6m
- Counting SortSkip comparisons entirely when the values are small.5m
- Which Sort When?The right sort is the one that fits your data's shape.5m