Recursion & DP easy time O(n) space O(n)
DP — Fibonacci Table
Build the answers bottom-up in a table instead of recursing top-down. Each entry is the sum of the two before it, computed exactly once. Compare with the recursive call tree, which recomputes the same values over and over.
Fill a table of 9 entries from the bottom up — each one computed exactly once.
1 / 18
A fixed scene — scrub through it, or open the code.
Practice
Machine twin: /dsa-viz-v2/dp-fibonacci.json — the full deterministic run as structured data.