← All sections
Binary
Binary search as a natural continuation of arrays; bits as an independent module.
0/7 lessons · exam: 0/30%
Lessons
- ✓01
Recognizing binary search and bits
The section's two themes, when each one shows up, and why O(log n) is so powerful.
- ✓02
Pattern 1: Binary Search
Cutting the search space in half at each step — the essence of O(log n).
- ✓03
Pattern 2: Modified binary search (rotated array)
When the array has been rotated: decide which half is sorted and keep cutting.
- ✓04
Pattern 3: Bit fundamentals
Thinking in binary: AND, OR, XOR, NOT, shifts and masks.
- ✓05
Pattern 4: The power of XOR
The a^a=0 property that makes pairs cancel out and reveals what's left.
- ✓06
Pattern 5: Bit techniques
Reusing counts (counting bits), reversing bits and summing without the + operator.
- ✓07
Synthesis: which pattern to use?
The Binary section's decision tree and the overall quiz before the final exam.
1 easy + 1 medium + 1 hard — unseen problems
With hidden test cases, just like the real LeetCode. This is where you confirm you can leave the section solving any problem of the topic.