Guides
Short guides to the questions that cut across individual algorithms.
Which sorting algorithm should you use?
A practical way to pick a sorting algorithm: data size, nearly sorted input, memory, stability, integer keys and worst-case limits, with worked examples.
Stable sorting explained
What a stable sort guarantees, why sorting by two columns needs it, which of the 23 algorithms on this site are stable, and how to make an unstable sort stable.
Comparison sorts versus counting, radix and bucket sort
Why no comparison sort can beat n log n, how counting, radix and bucket sort get around the limit by using the keys directly, and what they pay for it.
How the counts on this site work
The exact rules behind every number on screen: what counts as a comparison, read, write or swap, how helper buffers are counted, and how time is measured.