Skip to content
BytePatterns

Recursion

Watch the call stack grow, shrink, and finally make sense.

Recursion progress0 / 5
  1. Recursion BasicsA function that solves a smaller copy of itself.5m
  2. The Call StackEvery pending call waits its turn on a stack of frames.5m
  3. Factorial and FibonacciOne call per step, or two calls that redo everything.6m
  4. MemoizationWrite each answer down once, never solve it twice.5m
  5. BacktrackingChoose, explore, then undo the choice and try the next.6m