01Chapter 1: Recurrence Relations: Defining a Function in Terms of ItselfA recurrence relation defines a function by giving its value on small inputs directly and its value on larger inputs in terms of its own values on smaller inputs. In algorithm analysis, the function is usually a running time T(n), and the recurrence describes how the cost of a problem of size n depe2 min read
02Chapter 2: From Recursive Code to a Running-Time RecurrenceThis chapter assumes you can read recursive Python functions and that you know Big-Theta notation. Here we only turn code into a recurrence. Solving that recurrence comes in later chapters.2 min read
03Chapter 3: Solving by UnrollingThis chapter assumes you can read Big-Theta notation, sum arithmetic and geometric series, and use the identity 2^(log2 n) = n. You should also be able to write a recurrence from recursive code, which the previous chapter covered.2 min read
04Chapter 4: Recursion Trees: Summing Work Level by LevelThis chapter assumes you know Big-Theta notation, can sum a geometric series, and have seen how to derive a recurrence from recursive code. Unrolling works well when each call makes only one recursive call. When a call branches into several subproblems, the substitutions get hard to follow. A recurs2 min read
05Chapter 5: The Substitution Method: Guess, Then Prove by InductionThis chapter assumes you know Big-O and Big-Theta notation, proof by mathematical induction, and the basic log identities such as log(n/2) = log n − 1 for base-2 logs. A recursion tree gives you a believable guess. The substitution method turns that guess into a proof.3 min read
06Chapter 6: The Master Theorem for T(n) = aT(n/b) + f(n)This chapter assumes you can use Big-O, Big-Omega, and Big-Theta notation, and that you know the identity log_b a = ln a / ln b. It also builds on the recursion trees from the earlier chapter. Here you will learn the theorem's statement and how to read its three parameters from a recurrence. Later c2 min read
07Chapter 7: The Key Comparison: f(n) Versus n^(log_b a)This chapter assumes you can read the recurrence T(n) = aT(n/b) + f(n), identify a, b, and f(n), and use the identity a^(logb n) = n^(logb a). Every master theorem case comes from one comparison, between f(n) and the function n^(log_b a). This chapter explains what that function measures and how t2 min read
08Chapter 8: Case 1: When the Leaves DominateThis chapter assumes you know Big-O and Big-Theta notation, can identify a, b, and f(n) in T(n) = aT(n/b) + f(n), and know that the watershed function is n^(log_b a). Case 1 covers recurrences where f(n) is polynomially smaller than the watershed.2 min read
09Chapter 9: Case 2: When Every Level Does Equal WorkThis chapter assumes you know Big-Theta notation and logarithm identities, and that you have seen how a recursion tree adds up work level by level. It also assumes you have read the previous chapter on comparing f(n) with the watershed function n^(log_b a).2 min read
10Chapter 10: Case 3: When the Root Dominates, and the Regularity ConditionThis chapter assumes you know the statement of the master theorem for T(n) = aT(n/b) + f(n), how to compute the critical exponent log_b a, and how to sum a geometric series. Case 1 covered recurrences where the leaves do most of the work. Case 3 covers the opposite situation, where the top of the re2 min read
11Chapter 11: Extended Case 2: Recurrences with Log FactorsThis chapter assumes you know the three basic master theorem cases and can sum a series like 1 + 2 + ... + L. It covers one common recurrence the basic theorem misses, and the extension that solves it.3 min read
12Chapter 12: Gaps and Non-Examples: When the Master Theorem Does Not ApplyThis chapter assumes you know the three master theorem cases, the extended case 2, and how to build a recursion tree. Here we look at recurrences where the theorem gives no answer, so that you can spot them early and pick a different tool.3 min read
13Chapter 13: Why the Three Cases Arise: A Proof SketchThis chapter assumes you know the recursion tree method, the statement of the master theorem, and how to sum a geometric series. To keep the algebra simple, we take n to be an exact power of b. The chapter on floors and ceilings explains why this assumption doesn't change the result.2 min read
14Chapter 14: Floors, Ceilings, and Base Cases Without WorryThis chapter assumes you can apply the master theorem, build a recursion tree, and run a substitution proof by induction. Real code rarely splits inputs into exact halves. The question here is when you can ignore the rounding and the base case, and how to justify doing so.2 min read
15Chapter 15: Beyond Divide and Conquer: Linear Recurrences and Characteristic EquationsThis chapter assumes you can read recursive code, are comfortable with Big-Theta notation, and can solve a quadratic equation. Some recursive algorithms do not cut the input by a constant factor. Naive Fibonacci calls itself on n - 1 and n - 2, so its subproblem sizes are n minus a constant ra2 min read
16Chapter 16: Uneven Splits: The Akra-Bazzi MethodThis chapter assumes you know the master theorem and its three cases, recursion trees, and how to integrate simple powers like u^k and 1/u. It covers the recurrences the master theorem cannot solve because the subproblems have different sizes.3 min read