Core Patterns
Binary Search
Halve the search space every step: one first-true template covers sorted arrays, lower/upper bounds, rotated arrays, matrices and "binary search on the answer".
0 of 3 lessons complete, 0 of 7 problems solved
Coursework
37 min
Up next
Halving the Search Space
Why binary search is O(log n), what it needs to work, and how to spot it.
10 min
The One Template: First True
A single off-by-one-proof loop for lower bound, upper bound and every variation.
13 min
Search the Answer, Rotations and Grids
Binary search over a range of answers, rotated sorted arrays, and 2D matrices as 1D.
14 min
Practice ladder
Start with the first problem, then work toward the harder variations. Run examples before submitting against all tests.
Next unit: Linked Lists