Algorithms articles
Sliding windows and binary search through to network flow, string matching and modular combinatorics. Ordered by what each one depends on, not by how hard it is.
- Two Pointers
How the two-pointer technique turns an O(n²) nested loop into a single O(n) pass, the two shapes it comes in, and where interviewers actually push on it.
- Sliding Window
How to turn 'find the best contiguous subarray/substring' from an O(n²) scan of every start and end into a single O(n) pass — and how to tell when the window should grow, and when it must shrink.