/fibonacci

Primary LanguageJavaScript

fibonacci

This classic coding challenge completed in three different ways:

  1. Iterative for loop

  2. 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

  3. 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