Dynamic Programming21 sections · 916 units
Open in Course

What Is Tabulation?

Building from ground up

Now I'll show you tabulation, the iterative approach to DP (dynamic programming). Instead of starting with the problem you want and recursing down (top-down), you start with the simplest base cases and build up to your answer (bottom-up).

I like to think of it like filling out a table: you know fib(0) = 0 and fib(1) = 1, so you write those down. Then you compute fib(2) using those, then fib(3) using fib(1) and fib(2), and so on until you reach fib(n). You're constructing the solution step-by-step from the ground up. There's no recursion anymore, just loops and arrays.