Data Structures & Algorithms · preview
Reason from the constraint to the algorithm.
Start with the structures that hold the data. Then learn four patterns by their movement rules, invariants, and failure cases—not by memorizing finished solutions.
Start with arrays7 foundations4 complete pattern modules3 implementation languagesPreview more modules in development
Part 01
Foundations
Understand the operations and costs before choosing a pattern.
- 01ArrayA contiguous row of equal-sized slots. An index identifies a slot directly.Open →
- 02StringAn indexed sequence of characters, with immutability rules that depend on the language.Open →
- 03Hash MapA table that associates each unique key with one value.Open →
- 04Hash SetA hash table that records only whether a value is present.Open →
- 05StackA last-in, first-out collection: only the most recently added item is exposed.Open →
- 06QueueA first-in, first-out collection: new items join the back and leave from the front.Open →
- 07Linked ListA chain of nodes. Each node stores a value and a reference to the next node.Open →
Part 02
Problem-solving patterns
Recognition signals, invariants, implementation, complexity proof, and related problems.
- 01Two PointersUse two positions whose movement can eliminate choices without checking every pair.Open →
- 02Sliding WindowMaintain a summary of one contiguous range while its boundaries move.Open →
- 03Fast & Slow PointersUse either different speeds or a fixed gap to recover position information from a one-way chain.Open →
- 04Monotonic StackKeep unresolved positions in value order so a new item can answer several of them at once.Open →
Not published yet
The next modules will appear only when their lessons are complete.
Merge Intervals, Binary Search on Answer, graph traversal, backtracking, heaps, and prefix sums remain in development.