Fibonacci (Recursion Tree) — interactive algorithm visualization
Easy · Recursion · time O(2^n) · space O(n)
Naive fib(n) - the call tree is the lesson: exponential repeated work that memoization later collapses.
Example input: n = 5
Step through a verified execution trace - every step shows the real state, the invariant that keeps the algorithm correct, and asks you to predict what happens next.
Solve Fibonacci (Recursion Tree) in the editor · All 16 visualizations