Hermes Wiki

Sorting Algorithms

Comparison sorts (quicksort, mergesort, heapsort) and non-comparison sorts (counting, radix, bucket) — mechanics, stability, and when each wins.

Why we need this / what value this brings

Sorting shows up constantly as a subroutine inside harder problems, not just as 'sort this array' on its own.

When to use this

Interview problems that reduce to sorting first, or explaining why a language's built-in sort (Timsort in Python, etc.) is the right default over hand-rolling one.

How to use or implement this

Know quicksort/mergesort well enough to implement from memory and explain their worst cases; know when a non-comparison sort's O(n) beats O(n log n).

Research questions

  • Worth a hands-on Challenge implementing quicksort with a bad pivot choice, to feel the O(n^2) worst case directly?

Empty folder — drop notes, links, and findings here as you research.

Hermes Wiki