We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Fast Fibonacci – Tabulation

We actually have a few different dynamic programming techniques to choose from, even with a problem as simple as the Fibonacci sequence.

Memoization is considered a "top-down" optimization. It's top-down because we start with the whole problem and then move down into the subproblems (via recursive function calls).

Bottom-Up Dynamic Programming

What if we took the opposite approach, starting with the subproblems and working our way up to the overall problem? That would be a "bottom-up" technique, and there's a good way of doing that for the Fibonacci numbers, called tabulation.

Tabulation involves solving all the subproblems first, then assembling their solutions into the final solution.

Assignment

Just like before, we need to complete an alternative fast version of the fibonacci function so that we have an answer key for the Mappy interview process.

Update fibonacci to be even faster using tabulation.