📖 Book · algorithms · high

📊 Sorting algorithms, end to end

Bubble, selection, insertion, merge, quick & heap sort — runnable, with complexity and when to use which.

Every classic sort implemented and runnable: the O(n²) elementary sorts (bubble, selection, insertion), O(n log n) merge and heap, average-O(n log n) quicksort, and binary search — with the stability / in-place / complexity trade-offs and what std::sort (introsort) actually does.

6 chapters▶ runnable code✦ in-depth animation

What this book covers

  1. 01Why sorting is the interview rite of passage
  2. 02The O(n²) sorts — bubble, selection, insertion
  3. 03Merge sort — guaranteed O(n log n), stable
  4. 04Quick sort — fast in practice, in-place
  5. 05Heap sort — O(n log n), in-place, not stable
  6. 06Binary search & choosing a sort

Read it in full — runnable C++ + step-through animations

Every chapter of Sorting algorithms, end to end ships complete, editable code you compile and run in the browser, plus the same in-depth animations as the lessons.

Sorting algorithms, end to end — C++ Deep-Dive Book (runnable code + animation) · C++ Interview Prep