DSA · Reimagined
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.

dp[i] = the i-th Fibonacci number
0
1
2
3
4
5
6
7
8

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.