Computer science foundations study the cost and structure of computation. The useful mental model is: algorithms transform inputs into outputs, data structures control access patterns, and complexity tells you which ideas survive when problem size grows.
Core sequence:
- Big-O and Complexity Analysis - describes how time and memory scale with input size.
- Sorting and Selection - canonical problems for comparison, divide-and-conquer, and order statistics.
- Hash Tables - trade memory and hashing assumptions for expected constant-time lookup.
- Graphs and Traversals - models pairwise relationships and search over connected structure.
- Dynamic Programming - solves problems by reusing overlapping subproblem solutions.
- P vs NP and Intractability - separates efficiently solvable problems from problems where verification may be easier than search.
- Randomized Algorithms - uses randomness to simplify algorithms or improve expected performance.
- Floating Point and Quantization - explains numerical approximation in real hardware.
How the pieces fit:
- Big-O gives the scale model for computation.
- Sorting, selection, hash tables, and graph traversal are basic algorithmic tools.
- Dynamic programming exploits repeated structure instead of recomputing.
- Complexity theory warns when exact search is likely to be infeasible.
- Randomization trades deterministic guarantees for simpler or faster expected behavior.
- Floating point and quantization connect abstract algorithms to finite machine arithmetic.
Core equations to keep active:
- Complexity comparison: asymptotically.
- Graph traversal cost: BFS/DFS run in .
- Dynamic programming recurrence pattern: .
- Hash table expected lookup: under a good hash function and controlled load factor.
- Verification view of NP: a proposed solution can be checked in polynomial time.
- Floating point relative error pattern: for small .
See also: Computational Complexity of Attention, Memory Hierarchy and IO-Awareness