Algorithms and Data Structures¶
Classic CS fundamentals. The pieces underneath search ranking, recommendation, and model inference. Each post walks the problem and a clean implementation.
Data structures¶
- LRU Cache. O(1) get/put with a hash map and a doubly linked list.
- Flatten Nested List. Iterator pattern over arbitrarily nested structures.
- Stack, Queue, Heap. Core data structure implementations.
Graph and tree¶
- Connected Islands. BFS/DFS to find the largest connected component.
- Graph Algorithms. Traversal, shortest path, related problems.
- Tree Algorithms. Traversal, search, tree manipulation.
Sorting and searching¶
- Sort Algorithms. Merge sort, quicksort, when to use which.
- K-Nearest Points. Heap vs. sort approach for nearest-neighbor.
- String Match. Pattern matching algorithms.
- K Complementary. Finding pair sums in arrays.
Strings and parsing¶
- Rule Parser. String parsing with structured rules.
- Split String. Word-boundary-aware string splitting.
- String Rotation. Detecting rotation via the concatenation trick.
- Sub Domain Hits. Counting subdomain visit frequencies.
Classics¶
- FizzBuzz. The classic, done cleanly.
- Merge Sorted Lists. Two-pointer merge.
- Large File Processing. Top-K from a 50GB file using heaps.