Algorithms & Data Structures
Choose representations from constraints, derive invariants and proofs, implement reliable algorithms, and test them against adversarial cases.
5 sections · 40 units · about 159 hours
- Cost models, asymptotic notation and cases4h
- Aggregate, accounting and potential amortized analysis4h
- Loop invariants, brute-force oracles and differential tests4h
- Arrays, strings, locality and linked structures5h
- Hash tables: collisions, load factor, resizing and tombstones4h
- Stacks, queues, deques and monotone structures5h
- Two pointers and sliding windows5h
- Prefix sums, difference arrays and prefix plus hash4h
- Sorting contracts, lower bounds and merge sort5h
- Partitioning, quicksort, quickselect and top-k5h
- Binary search: intervals, bounds and feasibility predicates5h
- Tree representation and traversals4h
- Binary search trees, balance and augmented trees5h
- Heaps and priority queues4h
- Tries and prefix lookup3h
- Interval ordering, merging and sweep lines4h
- Graph modeling, representations and state graphs4h
- BFS, unweighted shortest paths and connected components4h
- DFS, cycle detection and bipartite testing4h
- Topological ordering and strongly connected components4h
- Union-find with path compression and union by rank3h
- Dijkstra, Bellman-Ford and negative cycles5h
- Minimum spanning trees with Kruskal and Prim4h
- Graph certificates and exhaustive small-graph validation3h
- Flow and matching at recognition depth2h
- Recursion contracts, backtracking and sound pruning4h
- Divide and conquer, recurrences and partition-based selection5h
- Greedy choice, optimal substructure and exchange arguments4h
- Greedy counterexamples and interval scheduling4h
- Randomized correctness, expected cost and selection4h
- Reservoir sampling, unbiased shuffling and empirical checks4h
- Dynamic programming states, transitions and base cases3h
- Memoization, tabulation and dependency order3h
- Solution reconstruction and rolling state3h
- Sequence and string dynamic programming4h
- Grid, path and interval dynamic programming4h
- Tree dynamic programming3h
- Knapsack, subset and bitmask dynamic programming4h
- Recurrence proofs and differential validation3h
- Dynamic programming as shortest paths, formulations and limits4h
Final project: Scheduler & Stream Algorithms Lab
Review the stage through three small artifacts drawn from the Algorithms and Data Structures Laboratory. Keep the evidence compact enough to inspect, rerun and defend without completing another problem list.
- Correctness library - hash map, mutable-priority heap, union-find, one graph routine and one reconstructing DP, each with an invariant and complexity note
- Failure evidence - generated operation histories, adversarial cases, minimized failures and repairs for at least two seeded defects
- Transfer and measurement - one unfamiliar problem solved cold plus one benchmark connecting asymptotic behavior, input distribution and memory locality
How it's graded · about 8 to 12 hours
Correctness library
Pass: A hash map, a mutable-priority heap, union-find, one graph routine and one reconstructing DP, each with its invariant, a complexity note and a test against an independent oracle, all run by one command.
Great: Each structure has a stateful or property test over operation histories, and every invariant is also asserted in a debug mode.
Failure evidence
Pass: At least two seeded defects, each with the generated history or adversarial case that exposed it, the minimized failure and the repair.
Great: Every minimized failure is kept as a regression test and mapped to the invariant it broke.
Transfer
Pass: One unfamiliar problem solved cold, with the invariant and bound written before code: a tag-hidden problem from the mini-projects or a new free LeetCode problem.
Great: The cold solve records a rejected first idea and the counterexample that killed it.
Measurement
Pass: One benchmark connects asymptotic behavior, input distribution and memory locality, such as the hash map's probes across key distributions, or a NumPy gather through a shuffled index against a sequential one at sizes below and above the cache.
Great: Predictions are written before measuring, and the benchmark shows the working-set effect across sizes.
Rebuild
Pass: A README lists the commands that rerun every test and benchmark.
Great: One command reruns everything, with the setup needed to reproduce it stated.