Sort Algorithm Reference

A reference list of 45 sorting algorithms, grouped into five tiers from the sorts every developer should know to the ones that exist only to make a point. Each one comes with a short note on why it matters and a link to its Java guide.
There are dozens of sorting algorithms, and they are not all equally worth your time. This reference sorts the sorts: it groups every algorithm covered by the Algorithm Guide into five tiers, from the ones taught in every computer science course to the ones that exist only as jokes.
How to Use This Reference
Each tier on the reference page lists its algorithms with a short note on why each one matters. Algorithms that already have a guide link straight to it, with the theory, a step-by-step walkthrough and a Java implementation. The rest are marked as coming soon, and the list grows as new guides are published.
- New to sorting? Start with Tier 1 and work through the six essential sorts in order.
- Preparing for interviews? Tier 1 and the partitioning problems in Tier 3 cover what you’re most likely to be asked.
- Curious how real libraries sort? Tier 2 explains the algorithms behind
Arrays.sort(), Python’ssorted()and C++’sstd::sort.
The Five Tiers
| Tier | Title | What it covers | Algorithms |
|---|---|---|---|
| 1 | The Essentials | The sorts taught in every course and asked about in interviews | 6 |
| 2 | Important in Practice or Theory | Library sorts, linear-time non-comparison sorts and topological sort | 8 |
| 3 | Well Known, More Specialised | Variations on the basic sorts, sorts built on other data structures and sorts for parallel hardware | 16 |
| 4 | Niche or Rarely Taught | Hybrids, curiosities and exercises | 11 |
| 5 | Jokes and What Not to Do | Sorts that exist to show how not to sort | 4 |
Start with the Essentials
All six Tier 1 sorts already have a full guide:
| Algorithm | Why it matters | Guide |
|---|---|---|
| QuickSort | The standard divide-and-conquer sort and the basis of most library sorts | QuickSort in Java |
| Merge Sort | A stable O(n log n) sort and a great way to learn recursion | Merge Sort in Java |
| Heap Sort | An in-place O(n log n) sort that also teaches you how heaps work | Heap Sort in Java |
| Insertion Sort | The best choice for small or nearly sorted input, and a building block of hybrid sorts | Insertion Sort in Java |
| Bubble Sort | The classic first sorting algorithm | Bubble Sort in Java |
| Selection Sort | The other basic O(n²) sort, and a useful contrast to bubble sort | Selection Sort in Java |
Once you know these, the Problem-Solving Patterns Reference shows the patterns behind them, such as recursion and divide and conquer, and where else those patterns are used.