Textbook section
Week 4: Recursion
Read the chapters for Week 4 as clean web pages with navigation, code blocks, and section links.
Ch. 16: Recursive ThinkingChapter 16: Recursive ThinkingYou already saw a small taste of this in Week 3 (Chapter 15), with
Ch. 17: Base Cases and TerminationChapter 17: Base Cases and TerminationEvery recursive function you write this week — and for the rest of your
Ch. 18: The Call Stack in DepthChapter 18: The Call Stack in DepthIn Week 3 (Chapter 15), you met the call stack as a mental model: every
Ch. 19: Classic Recursive ProblemsChapter 19: Classic Recursive ProblemsThe Fibonacci sequence is defined as: fib(0) = 0, fib(1) = 1, and for
Ch. 20: Mutual Recursion and Recursion vs. IterationChapter 20: Mutual Recursion and Recursion vs. IterationSo far, every recursive function you've seen calls itself. But