- Rust 84.3%
- Nushell 9.9%
- Makefile 4.1%
- HTML 1.7%
| .agents/skills/algo-weekly-booster | ||
| .vscode | ||
| weeks | ||
| .gitignore | ||
| bootstrap.nu | ||
| Cargo.toml | ||
| katex.html | ||
| Makefile | ||
| README.md | ||
🌲 Algo-Weekly: A Year of Algorithms & Data Structures
Welcome to Algo-Weekly! The mission of this project is to implement, document, and master one core algorithm or data structure every week for the next 52 weeks (one full year).
As a Computer Science graduate, this curriculum is designed to bypass the absolute basics (like standard binary search trees or simple sorting algorithms) and move swiftly into more advanced, elegant, and practical concepts used in modern systems, databases, distributed engines, and advanced engineering fields.
📅 Roadmap Overview
gantt
title Algo-Weekly 52-Week Curriculum
dateFormat YYYY-MM-DD
section Q1: Advanced Structures
Weeks 1-13 :active, 2026-06-01, 91d
section Q2: Graphs & Networks
Weeks 14-26 : 2026-08-31, 91d
section Q3: DP, Strings & AI
Weeks 27-39 : 2026-11-30, 91d
section Q4: Systems & Distributed
Weeks 40-52 : 2027-03-01, 91d
- Quarter 1: Advanced & Probabilistic Data Structures (Weeks 1–13)
- Quarter 2: Advanced Graph & Network Theory (Weeks 14–26)
- Quarter 3: Dynamic Programming, Advanced Strings, & Search AI (Weeks 27–39)
- Quarter 4: Geometry, Spatial, Distributed & Systems Algorithms (Weeks 40–52)
🛠️ Repository Organization
Each week has its own self-contained workspace under
weeks/week-[01-52]-[topic-name]/ containing:
README.md: Theoretical explanation, time/space complexity analysis, and key use cases.- Implementation: Elegant, fully tested implementation in Rust.
- Tests/Benchmarks: Rigorous correctness testing and performance benchmarks.
To streamline this process, you can use the custom Nushell bootstrap helper:
use bootstrap.nu
bootstrap 1 "skip-list"
📚 The 52-Week Curriculum
🌸 Quarter 1: Advanced & Probabilistic Data Structures (Weeks 1–13)
Focusing on non-trivial self-balancing trees, write-optimized storage engines, probabilistic membership filters, and fast range query engines.
| Week | Status | Topic | Category | Description | Complexity (Average) |
|---|---|---|---|---|---|
| 01 | [ ] | Skip List | Self-Balancing | A probabilistic alternative to balanced BSTs using hierarchical linked lists. | Search/Insert: O(\log N) |
| 02 | [ ] | Treap | Self-Balancing | A randomized Binary Search Tree combining tree properties with heap priorities. | Search/Insert: O(\log N) |
| 03 | [ ] | Trie & Radix Tree | Prefix Trees | Space-optimized prefix trees for string retrieval and IP routing tables. | Search: O(K) key length |
| 04 | [ ] | Disjoint Set Union (DSU) | Graph/Set | DSU with Path Compression and Union by Rank/Size. | Union/Find: O(\alpha(N)) |
| 05 | [ ] | Bloom Filter | Probabilistic | Space-efficient set membership with zero false negatives but possible false positives. | Query/Insert: O(k) hashes |
| 06 | [ ] | Fenwick Tree | Range Query | Binary Indexed Tree (BIT) supporting efficient prefix sums and point updates. | Query/Update: O(\log N) |
| 07 | [ ] | Segment Tree | Range Query | Segment tree with Lazy Propagation supporting range queries and range updates. | Query/Update: O(\log N) |
| 08 | [ ] | Splay Tree | Self-Balancing | Self-adjusting BST that moves recently accessed elements to the root using rotations. | Amortized: O(\log N) |
| 09 | [ ] | B-Tree & B+ Tree | Systems | Multi-way self-balancing search trees optimized for disk block writes and page layouts. | Search/Insert: O(\log N) |
| 10 | [ ] | LSM Tree | Systems | Log-Structured Merge-Tree optimized for write-heavy systems (e.g., RocksDB, Cassandra). | Writes: O(1) amortized |
| 11 | [ ] | Binomial Heap | Heap | A mergeable priority queue made of a collection of binomial trees. | Merge: O(\log N) |
| 12 | [ ] | Fibonacci Heap | Heap | Theoretical superstar with optimal amortized bounds for graph shortest path algorithms. | Decrease Key: O(1) amortized |
| 13 | [ ] | Sparse Table | Range Query | Static range minimum queries (RMQ) in constant time after preprocessing. | Prep: O(N \log N), Query: O(1) |
🌿 Quarter 2: Advanced Graph & Network Theory (Weeks 14–26)
Exploring connectivity, shortest paths under constraints, flow networks, matching problems, and tree decomposition techniques.
| Week | Status | Topic | Category | Description | Complexity |
|---|---|---|---|---|---|
| 14 | [ ] | Tarjan's SCC | Connectivity | DFS-based single-pass algorithm to find strongly connected components in directed graphs. | O(V + E) |
| 15 | [ ] | Kosaraju's Algorithm | Connectivity | Elegant two-pass DFS using transposed graphs for finding SCCs. | O(V + E) |
| 16 | [ ] | Bellman-Ford & SPFA | Shortest Path | Shortest paths with negative edge weights and negative cycle detection. | O(V \cdot E) / O(E) avg |
| 17 | [ ] | Floyd-Warshall | Shortest Path | Dynamic programming approach to solve the all-pairs shortest path problem. | O(V^3) |
| 18 | [ ] | A Search Algorithm* | Shortest Path | Heuristic-guided best-first search for pathfinding in graphs and grids. | Dependent on heuristic |
| 19 | [ ] | MST Optimizations | Minimum Spanning | Implementing Kruskal's (with DSU) & Prim's (with Fibonacci Heap) and comparing performance. | O(E \log V) or O(E + V \log V) |
| 20 | [ ] | Ford-Fulkerson & Edmonds-Karp | Network Flow | Computing maximum flow in a flow network using augmenting paths. | O(V \cdot E^2) (Edmonds-Karp) |
| 21 | [ ] | Dinic's Algorithm | Network Flow | Fast maximum flow using level graphs and blocking flows via scaling. | O(V^2 E) |
| 22 | [ ] | Hopcroft-Karp | Matching | Maximum cardinality bipartite matching using augmenting path techniques. | O(E \sqrt{V}) |
| 23 | [ ] | Hierholzer's Algorithm | Eulerian | Finding Eulerian paths and circuits (visiting every edge exactly once). | O(V + E) |
| 24 | [ ] | Bridges & Cut Vertices | Connectivity | Linear-time discovery of critical edges (bridges) and articulation points using DFS. | O(V + E) |
| 25 | [ ] | LCA via Binary Lifting | Trees | Finding Lowest Common Ancestors using 2^k parent pointers to answer queries. |
Prep: O(N \log N), Query: O(\log N) |
| 26 | [ ] | Heavy-Light Decomposition | Trees | Decomposing a tree into heavy/light chains to support segment tree queries on trees. | Query: O(\log^2 N) |
🍂 Quarter 3: Dynamic Programming, Advanced Strings, & Search AI (Weeks 27–39)
Tackling linear-time string search, multi-pattern matching dictionaries, tree and digit DP, linear programming, and game-playing heuristics.
| Week | Status | Topic | Category | Description | Complexity |
|---|---|---|---|---|---|
| 27 | [ ] | KMP Algorithm | String Match | Knuth-Morris-Pratt string search utilizing prefix functions to avoid backtracking. | O(N + M) |
| 28 | [ ] | Rabin-Karp | String Match | Pattern matching using rolling hashes (Karp-Rabin finger-printing). | O(N + M) average |
| 29 | [ ] | Aho-Corasick | String Match | Constructing a trie-based finite state machine to search for multiple patterns simultaneously. | O(N + M + Z) |
| 30 | [ ] | Suffix Automaton | String Match | Minimal directed acyclic word graph representing all substrings of a string. | O(N) space & construction |
| 31 | [ ] | Bitmask & Digit DP | Dynamic Prog. | DP on subsets (bitmasks) and digit-by-digit constraints for combinatorial counting. | O(2^N \cdot N^2) or O(\text{digits} \cdot \text{states}) |
| 32 | [ ] | Tree & Interval DP | Dynamic Prog. | DP optimizations applied to structural sub-trees and sub-arrays (e.g., Matrix Chain Mult). | Dependent on subproblem |
| 33 | [ ] | Convex Hull Trick | DP Opt | Optimizing DP transitions from O(N^2) to O(N) by calculating lower envelopes of lines. |
O(N \log N) or O(N) |
| 34 | [ ] | Simplex Algorithm | Optimization | Solving linear programming problems to find optimal values under linear constraints. | O(2^D) worst-case, fast in practice |
| 35 | [ ] | Minimax & Alpha-Beta | Game AI | Adversarial tree search used for turn-based games (e.g., Chess, Checkers). | O(b^{d/2}) with perfect pruning |
| 36 | [ ] | Monte Carlo Tree Search | Game AI | Decision tree search based on randomized rollouts (MCTS - AlphaGo style). | Iterative / Anytime algorithm |
| 37 | [ ] | Hungarian Algorithm | Optimization | Kuhn-Munkres algorithm solving bipartite matching maximum weight assignment problems. | O(V^3) |
| 38 | [ ] | Boyer-Moore | String Match | String matching jumping characters from right-to-left using bad-character heuristics. | O(N) best case |
| 39 | [ ] | Manacher's Algorithm | String Match | Find all palindromic substrings in a string in linear time. | O(N) |
❄️ Quarter 4: Geometry, Spatial, Distributed & Systems (Weeks 40–52)
Venturing into spatial partitions, lossless compression systems, distributed load balancing, consistency topologies, and consensus mechanisms.
| Week | Status | Topic | Category | Description | Complexity |
|---|---|---|---|---|---|
| 40 | [ ] | Convex Hull | Geometry | Calculating the smallest convex polygon enclosing a set of 2D points (Graham & Jarvis). | O(N \log N) (Graham Scan) |
| 41 | [ ] | Sweep Line Algorithms | Geometry | Using a vertical line sweep to detect segment intersections and closest point pairs. | O(N \log N) |
| 42 | [ ] | Quadtree & k-d Tree | Spatial | Multi-dimensional spatial databases for range searches and nearest neighbors. | Search: O(\log N) average |
| 43 | [ ] | LRU, LFU, & ARC Cache | Systems | Implementing and benchmarking Least Recently Used, Least Frequently Used, and Adaptive Replacement Cache. | O(1) operations |
| 44 | [ ] | Huffman & LZW | Compression | Implementing entropy (Huffman) and dictionary-based (Lempel-Ziv-Welch) compression. | Compression: O(N) |
| 45 | [ ] | Consistent Hashing | Distributed | Scaling distributed keys across dynamic node rings with minimal key migration. | Hash ring lookup: O(\log S) |
| 46 | [ ] | HyperLogLog & Count-Min | Big Data / Stream | Cardinality estimation (HyperLogLog) and frequency analysis in streaming pipelines. | Space: O(1) relative, error: \sim 1/\sqrt{m} |
| 47 | [ ] | Merkle Tree & Vector Clocks | Distributed | Decentralized content verification (Merkle) and partial event ordering (Clocks). | Update/Verify: O(\log N) |
| 48 | [ ] | Raft Consensus Core | Distributed | Implementing leader election and log replication fundamentals of the Raft consensus protocol. | O(1) normal path operation |
| 49 | [ ] | CRDTs | Distributed | State and operation-based Conflict-Free Replicated Data Types (G-Counter, OR-Set). | O(1) update, merge: O(S) |
| 50 | [ ] | Fast Fourier Transform | Signal / Math | O(N \log N) polynomial multiplication and frequency analysis of discrete signals. |
O(N \log N) |
| 51 | [ ] | PageRank | Networks | Stationary distribution of random walks over massive web graphs. | O(I \cdot (V + E)) iterations |
| 52 | [ ] | Cuckoo Filter / Hashing | Probabilistic | Dynamic deletion-capable set filter superior to Bloom Filters under high loads. | Query/Delete: O(1) worst case |
🚀 Getting Started
- Clone this repository to your development server/workstation.
- Review the next target week in the roadmap.
- Run the bootstrap script in Nushell to generate your structure:
nu bootstrap.nu 1 "skip-list" - Start implementing! Let's build a year of excellent coding habits.
"Bad programmers worry about the code. Good programmers worry about data structures and their relationships." — Linus Torvalds