Skip to content
Series
19 posts

Reading Stanford CS161 Design and Analysis of Algorithms

A lecture-by-lecture reading of Stanford CS161, Winter 2026: algorithm design, correctness proofs, and complexity analysis across all eighteen public lecture units.

Series guide

Design and Analysis of Algorithms: From Divide and Conquer and Graphs to Dynamic Programming and Max Flow | Stanford CS161 Course Overview

CS161 is Stanford's design and analysis of algorithms course: eighteen lectures go from asymptotic analysis, divide and conquer and randomized algorithms to graph algorithms, dynamic programming, greedy algorithms and max flow. Lecture notes, slides, the eight homework handouts, section problems with solutions and the Python notebooks are public; recordings, homework solutions and exams are not.

Designing Dynamic Programs for LCS, Knapsack, and Independent Set | Stanford CS161 Lecture 13

Lecture 13 turns dynamic programming into five steps: choose a state, derive transitions, fill the table, reconstruct a solution, and then improve the implementation. LCS takes O(mn), both knapsack variants take O(nW) pseudo-polynomial time, and maximum-weight independent set on a tree takes O(|V|).

When a Greedy Algorithm Turns Local Choices into a Global Optimum | Stanford CS161 Lecture 14

A greedy algorithm is not merely 'pick what looks best.' It keeps one choice at each step and needs an exchange argument proving that the choice preserves an optimum. Lecture 14 develops that proof pattern through activity selection, weighted completion time, and Huffman coding.