Showing Posts From

Two pointers

Two Pointers & Sliding Window (Advanced)

Two Pointers & Sliding Window (Advanced)

Week 19 notes: Phase 2 kicks off by pushing the two most reused array patterns to medium/hard. Variable windows with a shrink rule, the at-most/exactly counting trick, and multi-pointer partitioning.

Linked Lists: Traversal, Reversal & Cycles

Linked Lists: Traversal, Reversal & Cycles

Week 7 notes: linked lists trade O(1) indexing for O(1) splicing. The pointer-rewiring patterns I keep needing: reversal, fast/slow pointers, cycles, and the dummy head.

Two Pointers Algorithm - Intuition & Patterns

Two Pointers Algorithm - Intuition & Patterns

Week 0 notes on the two pointers technique: the 'squeeze' idea that kills a lot of nested loops, the two movement styles, and when to actually use it.