diff --git a/lectures/07_order_notation_recursion/README.md b/lectures/07_order_notation_recursion/README.md index d026d16..11a0e6d 100644 --- a/lectures/07_order_notation_recursion/README.md +++ b/lectures/07_order_notation_recursion/README.md @@ -263,16 +263,12 @@ of the vector in reverse order? ## 7.17 Fibonacci Optimization: Order Notation of Time vs. Space The Fibonacci sequence is defined: -$$ -F(n) = \begin{cases} -0 & \text{if } n = 0 \\ -1 & \text{if } n = 1 \\ -F(n-1) + F(n-2) & \text{otherwise} -\end{cases} -$$ +![alt text](fibonacci_sequence.png "fibonacci sequence") 1. Write a simple recursive version of Fibonacci that is a direct translation of the mathematical definition of the Fibonacci sequence. 2. Write an iterative version of Fibonacci that uses a vector to improve the running time of the function. 3. What is the order notation of the running time for each version? +- Play this [animation](https://jidongxiao.github.io/CSCI1200-DataStructures/animations/dynamic_memory/example1/index.html), which illustrates the time complexity of the recursvie version. + 4. What is the order notation of the memory usage for each version?