

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Intro to Dynamic Programming
incomplete
2: Fast Fibonacci – Memoization
incomplete
3: Memoization
incomplete
4: Fast Fibonacci – Tabulation
incomplete
5: Fast Fibonacci – Review
incomplete
This lesson's interactive features are locked, please to keep using them
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).
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.
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.