All modules Download notes (.txt) Warm-upCoreStretchTry these in the playground →
Intermediate -- Module 03
Functions & Recursion
Function declarations vs. definitions, pass-by-value semantics, static vs. global state, and recursion -- including how to reason about a call stack and when to prefer iteration.
Video lesson
Downloadable notes
Plain-text lecture notes for Functions & Recursion.
Practice problems
GCD by recursion
Implement Euclid's algorithm for greatest common divisor recursively.
Memoized Fibonacci
Write recursive fib(n) with an array-based memo table so fib(40) returns instantly.
Towers of Hanoi
Print the full move sequence for n disks and count total moves recursively.
Module quiz
1. C passes arguments to functions by:
2. A `static` local variable inside a function:
3. Every recursive function needs at minimum:
4. Deep uncontrolled recursion typically fails with: