01Chapter 1: Complexity and recurrences: the toolkit for comparing algorithmsYou should know Big-O, Big-Theta, and Big-Omega notation. You should also be able to trace loops, read simple recursive functions, and use arrays, stacks, queues, and heaps. Basic graph terminology is useful for later chapters.2 min read
02Chapter 2: Why a greedy choice is safe: the exchange argumentAssume you know asymptotic notation, basic recursion, arrays, and sorting. You should also understand intervals and why an algorithm that sorts n items usually takes O(n log n) time.2 min read
03Chapter 3: Fractional knapsack by value-to-weight ratioAssume you know asymptotic notation, sorting, and basic greedy algorithms. The fractional knapsack problem gives items with weights and values. A knapsack has a maximum capacity. You may take an entire item or any fraction of it.2 min read
05Chapter 5: Huffman coding and optimal prefix codesAssume you know Big-O notation, recursion, binary trees, and binary heaps. This chapter connects Huffman coding, a greedy algorithm, with the ideas that motivate dynamic programming.2 min read
06Chapter 6: Memoization and tabulation comparedAssume you know recursion, asymptotic notation, arrays, and basic dynamic programming terminology. This chapter compares two ways to evaluate the same dynamic programming recurrence.2 min read
08Chapter 8: Longest common subsequenceAssume you know Big-O notation, arrays, loops, strings, and how a two-dimensional table stores values. A subsequence is a sequence formed by deleting zero or more characters without changing the order of the remaining characters. The characters do not need to be adjacent.2 min read
09Chapter 9: Edit distanceAssume you know Big-O notation, arrays, recursion, and basic dynamic programming terms. Both problems use a table whose entries describe optimal answers to smaller subproblems.2 min read
10Chapter 10: Coin change: counting ways and minimum coinsAssume you know Big-O notation, arrays, loops, and basic graph terms such as vertex and edge. This chapter uses dynamic programming (DP), which stores answers to smaller subproblems so they can be reused.2 min read
11Chapter 11: BFS and DFS: traversal order, edge types, and complexityAssume you know adjacency lists, queues, stacks, recursion, and basic graph terms. This chapter uses directed and undirected graphs. A graph traversal visits reachable vertices while avoiding repeated visits.2 min read
12Chapter 12: Topological sort of a DAGAssume you know graph representations, queues, stacks, recursion, and asymptotic notation. This chapter uses directed graphs and focuses on directed acyclic graphs (DAGs).2 min read
14Chapter 14: Kruskal's and Prim's algorithmsAssume you know vertices, weighted edges, connected graphs, minimum spanning trees, sorting, priority queues, and the union-find data structure. A minimum spanning tree (MST) is a set of edges that connects every vertex, contains no cycle, and has minimum total weight.2 min read
15Chapter 15: Single-source shortest paths and relaxationAssume you know weighted graphs, adjacency lists, queues, and asymptotic notation. A single-source shortest-path (SSSP) problem asks for the minimum-cost path from one source vertex \(s\) to every reachable vertex.2 min read
17Chapter 17: Floyd-Warshall all-pairs shortest pathsAssume you know weighted graphs, adjacency matrices, dynamic programming, and the meaning of a shortest path. Floyd-Warshall computes the shortest distances between every pair of vertices. It works with directed or undirected graphs and allows negative edge weights, but not negative-weight cycles.1 min read