fibonacci
This classic coding challenge completed in three different ways:
-
Iterative for loop
-
Recursion: Process of taking a problem and breaking it into multiple, smaller instances of the same problem. Using the recursive process, we essentially are building up the call stack, getting down to our base case, and then unwinding the stack
-
Memoization: Optiimizing our previous recursive solution by "caching" the results of earlier calculations. That way, we don’t have to repeat the calculations later.
The three different strategies outline the various tradeoffs of each algorithm in terms of memory and runtime