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 those recursively, and then build the full answer from their answers. Most of the algorithms in this tutorial follow this pattern, so learning to spot its three steps is the first skil2 min read
02Chapter 2: Base Cases and Why Recursion TerminatesThis chapter assumes you can write and trace recursive functions in Python and read Big-O notation. Every divide-and-conquer algorithm needs two things to stop: a base case, and a guarantee that each recursive call moves toward it.2 min read
03Chapter 3: Proving Divide-and-Conquer Algorithms CorrectThis chapter assumes you can trace recursive functions, read Big-O notation, and have seen proof by mathematical induction. It also assumes you have read the earlier chapters on the divide, conquer, combine steps and on base cases.2 min read
04Chapter 4: Describing Running Time with RecurrencesThis chapter assumes you know Big-O notation, can trace a recursive function, and have seen the divide, conquer, combine pattern from earlier chapters. The goal here is to turn a recursive algorithm into an equation for its running time. The next two chapters cover how to solve those equations.2 min read
05Chapter 5: Solving Recurrences with Recursion TreesThis chapter assumes you can write a recurrence such as T(n) = 2T(n/2) + cn, as covered in the previous chapter. You should also be comfortable with logarithms and with summing a geometric series.2 min read
06Chapter 6: The Master Theorem and Its Three CasesThis chapter assumes you can write a recurrence for a divide-and-conquer algorithm and that you have used a recursion tree to sum the work level by level. The master theorem turns that level-by-level summation into a lookup. Most recurrences in this tutorial can be solved with it in a few seconds.2 min read
07Chapter 7: Binary Search: Discarding Half the InputThis chapter assumes you can read Python loops and indexes, know Big-O notation, and have seen the recurrence T(n) = T(n/2) + O(1) from the chapters on recurrences and the master theorem.2 min read
08Chapter 8: Merge Sort: The Canonical ExampleThis chapter assumes you can trace recursive functions, read Big-O notation, and apply the master theorem from the earlier chapters. Merge sort is the standard example of divide and conquer because each of its three steps is easy to see.2 min read
09Chapter 9: Quicksort: Doing the Work Before RecursingThis chapter assumes you know merge sort from the previous chapter, can trace recursive functions, and can read recurrences such as T(n) = 2T(n/2) + O(n).2 min read
10Chapter 10: Counting Inversions by Extending Merge SortThis chapter assumes you know merge sort from the previous chapter, can trace a recursive function, and can read Big-O notation. It shows how adding one line to the merge step turns merge sort into an inversion counter.2 min read
11Chapter 11: Maximum Subarray: Handling the Crossing CaseThis chapter assumes you can trace recursive functions, read Big-O notation, and solve recurrences such as T(n) = 2T(n/2) + O(n), as covered in the earlier chapters on recurrences and merge sort.2 min read
14Chapter 14: Strassen's Matrix MultiplicationThis chapter assumes you know the master theorem, the Karatsuba idea of trading multiplications for additions, and how ordinary matrix multiplication works.2 min read
15Chapter 15: Selection in Linear Time: Quickselect and Median of MediansThis chapter assumes you know quicksort's partition step, Big-O notation, and how to read recurrences. The selection problem asks for the k-th smallest element of an unsorted list. Sorting the list first solves it in O(n log n) time. Divide and conquer can do it in O(n).2 min read
16Chapter 16: Closest Pair of Points in the PlaneThis chapter assumes you know merge sort, the recurrence T(n) = 2T(n/2) + O(n), and the crossing-case idea from the maximum subarray chapter. Closest pair uses the same plan: solve the left half, solve the right half, then deal with answers that cross the split.2 min read
17Chapter 17: When Subproblems Overlap: Divide and Conquer Versus Dynamic ProgrammingThis chapter assumes you can trace recursive functions, read Big-O notation, and follow the merge sort and maximum subarray chapters. Both of those algorithms split their input into pieces that do not share any elements. This chapter covers what happens when subproblems do share work, and how to tel2 min read
18Chapter 18: Divide and Conquer in Practice: Cutoffs, Stack Depth, and ParallelismThis chapter assumes you have already worked through merge sort and quicksort, can read recursive Python, and know Big-O notation. The analysis so far has counted operations asymptotically. Real programs also pay for function calls, have a limited call stack, and run on machines with several cores. 2 min read