01Chapter 1: What Divide and Conquer Means: Divide, Conquer, CombineDivide and conquer is a way to design algorithms. You split a problem into smaller problems of the same kind, solve each one recursively, and then build the answer to the original problem from their answers. Many fast algorithms follow this pattern, including binary search, merge sort, quicksort, an5 min read
02Chapter 2: Base Cases and Why Recursion TerminatesThis chapter assumes you can write and trace recursive functions in Python, read Big-O notation, and work with list slicing and index ranges. It covers two related questions. What should a divide-and-conquer algorithm do when the input is small enough to solve directly? And how can you be sure that 6 min read
03Chapter 3: Proving Divide-and-Conquer Algorithms CorrectA divide-and-conquer algorithm calls itself on smaller inputs, so its correctness depends on its own correctness at smaller sizes. That might look circular. Strong induction is the tool that removes the circularity. This chapter gives you a proof template that fits almost every algorithm in the rest6 min read
04Chapter 4: Describing Running Time with RecurrencesThis chapter assumes you can trace a recursive function, read Big-O notation, and recognize the divide, conquer, and combine steps from earlier chapters. The goal here is to turn a recursive algorithm into an equation that describes its running time. Solving those equations is the job of the next tw5 min read
05Chapter 5: Solving Recurrences with Recursion TreesThis chapter assumes you can trace a recursive function and read Big-O notation. It also assumes you can write a recurrence such as T(n) = 2T(n/2) + n for a divide-and-conquer algorithm, which the previous chapter covered. You will need one piece of algebra: the sum of a geometric series.5 min read
06Chapter 6: The Master Theorem and Its Three CasesThis chapter assumes you can read Big-O, Big-Omega, and Big-Theta notation, write a recurrence for a recursive algorithm, and sketch a recursion tree as in the previous chapter. The master theorem gives the answer a recursion tree would give for a common family of recurrences, without drawing the tr5 min read
07Chapter 7: Binary Search: Discarding Half the InputBinary search is the simplest divide-and-conquer algorithm. It splits the input, solves one half, and throws the other half away. The combine step does nothing. That makes it a clean place to practice two skills from earlier chapters: proving correctness with an invariant, and reading running time o5 min read
08Chapter 8: Merge Sort: The Canonical ExampleMerge sort is the algorithm most textbooks use to teach divide and conquer, because each of its three steps is easy to see. The divide step is trivial, the conquer step is two recursive calls, and all of the real work happens in the combine step. This chapter assumes you can write and trace recursiv5 min read
09Chapter 9: Quicksort: Doing the Work Before RecursingThis chapter assumes you already know the merge sort chapter, the recurrence T(n) = 2T(n/2) + O(n), the master theorem, and how to trace recursive Python functions. You should also be comfortable swapping list elements in place.5 min read
10Chapter 10: Counting Inversions by Extending Merge SortThis chapter assumes you already know merge sort from the previous chapter: how it splits, recurses, and merges two sorted lists with two pointers. It also assumes the recurrence T(n) = 2T(n/2) + O(n) and its solution, O(n log n). Here you will add one line of bookkeeping to the merge step and get a6 min read
11Chapter 11: Maximum Subarray: Handling the Crossing CaseThis chapter assumes you can trace recursive Python functions, read Big-O notation, and apply the master theorem from the earlier chapter. It also helps to remember how merge sort splits a list at its midpoint, because the maximum subarray algorithm splits a list the same way.5 min read
12Chapter 12: Fast Exponentiation by Repeated SquaringThis chapter assumes you can read recursive Python, write a recurrence such as T(n) = T(n/2) + O(1), and apply the master theorem from earlier chapters. You will see how one observation, that x^n = (x^(n/2))², cuts the work of computing a power from n multiplications to about 2 log₂ n.5 min read
14Chapter 14: Strassen's Matrix MultiplicationThis chapter assumes you know the Karatsuba chapter's main idea: if you cut the number of recursive subproblems, the exponent in the running time goes down. It also assumes you can apply the master theorem, read Python list comprehensions, and multiply two matrices by hand.5 min read
15Chapter 15: Selection in Linear Time: Quickselect and Median of MediansThis chapter assumes you have read the chapter on quicksort and know how partitioning around a pivot works. It also assumes you can read recurrences and solve simple ones with a recursion tree. The selection problem asks for the k-th smallest element of an unsorted list. The median is the special ca6 min read
16Chapter 16: Closest Pair of Points in the PlaneThis chapter assumes you already know merge sort and its recurrence T(n) = 2T(n/2) + O(n), the crossing-case pattern from the maximum subarray chapter, and the master theorem. The problem is simple to state. You are given n points in the plane. Find the smallest Euclidean distance between any two of5 min read
17Chapter 17: When Subproblems Overlap: Divide and Conquer Versus Dynamic ProgrammingThis chapter assumes you can trace recursive functions, read a recurrence such as T(n) = 2T(n/2) + O(n), and follow the merge sort and maximum subarray chapters. Divide and conquer and dynamic programming both break a problem into smaller instances of the same problem. They differ in one structural 5 min read
18Chapter 18: Divide and Conquer in Practice: Cutoffs, Stack Depth, and ParallelismEarlier chapters judged algorithms by their asymptotic bounds. Real programs also pay for function calls, use stack memory for each pending recursion, and run on machines with several cores. This chapter covers three practical adjustments: small-input cutoffs, keeping recursion depth bounded, and sp5 min read