Book Exercise Lanes
This module's exercise system is book-driven. Use these local chunks for targeted volume after you have already learned the concept from the guide.
How To Use This Page
- Finish the relevant concept page first.
- Solve at least one problem of your own from memory.
- Only then open the matching exercise lane.
- Keep a mistake log with tags such as
off-by-one in binary search,assumed stability,forgot tombstones,confused peek and extract,miscounted recurrence level,used linear probing above 0.9 load,treated expected as worst case.
Lane 1: Comparison Sorts (Insertion, Merge, Quick) and Lower Bounds
Use this lane when you understand mergesort and quicksort at concept level but want fluency at writing partitions, merges, and analyzing their cost.
- CLRS: 2.1 Insertion Sort
- CLRS: 2.3 Designing Algorithms (mergesort)
- CLRS: 7.1-7.4 Quicksort
- CLRS: 8.1 Lower bounds for sorting
- Skiena: 4.11 Exercises
- Sedgewick: Quicksort exercises
- Sedgewick: Selection and merging exercises
Target outcomes:
- 3 mergesort implementations (recursive, iterative bottom-up, linked-list variant)
- 3 quicksort variants (Lomuto, Hoare, 3-way partition for duplicates)
- 2 decision-tree drawings for small
n - 2 recurrence solutions with the recursion-tree method
Lane 2: Linear-Time and Specialized Sorting
Use this lane when you want practice recognizing when to escape the comparison-sort lower bound.
- CLRS: 8.2 Counting Sort
- CLRS: 8.3 Radix Sort
- CLRS: 8.4 Bucket Sort
- Skiena: 4.1 Applications of Sorting
- Skiena: 4.7 Distribution Sort
- Sedgewick: Radix sorting exercises
Target outcomes:
- 1 counting sort implementation with explicit stability check
- 1 LSD radix sort on 32-bit integers with 8-bit passes
- 1 bucket sort implementation for uniform floats in
[0, 1) - 2 written comparisons of "when does this beat mergesort?"
Lane 3: Searching, Selection, and Hashing
Use this lane when you can describe the data structure but freeze when coding binary search variants, quickselect, or a hash table.
- CLRS: 9.1-9.3 Selection
- CLRS: 11.1-11.5 Hash Tables
- Skiena: 4.9 Binary Search
- Skiena: 3.7 Hashing and Strings
- Competitive Programming: 3.3.1 Interesting Usages of Binary Search
- Sedgewick: Elementary searching exercises
- Sedgewick: Hashing exercises
Target outcomes:
- 4 binary-search variants written with invariants (search, lower_bound, upper_bound, predicate-based)
- 2 quickselect implementations (naive recursive and in-place)
- 1 chaining hash table with resize
- 1 linear-probing hash table with tombstones
- 2 applied binary-search-on-answer problems
Lane 4: Heaps and Priority Queues
Use this lane when you want heap and PQ fluency without guessing at sift logic or library APIs.
- CLRS: 6.1-6.5 Heaps and Priority Queues
- Skiena: 3.5 Priority Queues
- Skiena: 4.3 Heapsort
- Skiena: 4.3.2 Constructing Heaps
- Sedgewick: Priority queue exercises
- Competitive Programming: 2.3 Non-linear DS with built-in libraries
Target outcomes:
- 1 from-scratch binary heap (sift_up, sift_down, push, pop, build)
- 1 heapsort implementation with trace
- 1 priority queue with
decrease_key(heap + index map) - 3 applied problems: Dijkstra on a small graph, top-K, median maintenance
- 1 Huffman code construction
Self-Curated Problem Set
Build a custom set with these minimums:
- 3 sorting problems where you choose the algorithm and justify the choice
- 3 searching problems that require binary search variants or predicate-based search
- 3 selection or top-K problems
- 3 hash table problems (implement, analyze, or attack)
- 3 priority-queue-shaped problems
Platforms you can pull from locally: Skiena and Sedgewick exercise chunks above. If you use external platforms (LeetCode, HackerRank, Codeforces), track them separately in your own notebook; this module's bookshelf is the default source.
Completion Checklist
- Completed at least two lanes in full
- Logged at least 10 real mistakes and corrections
- Wrote at least 6 full invariant or recurrence justifications
- Reattempted at least 3 failed problems after review
- Implemented at least 8 of the code katas from
practice/04-code-katas.md