Question: On visual studios code Lab Assignment 3 In this assignment you must implement the Fibonacci function by using both the na ve ( fibonacci _

On visual studios code
Lab Assignment 3
In this assignment you must implement the Fibonacci function by using both the
nave(fibonacci_naive) and memo (fibonacci_memo) approaches. Then, measure the time it takes
Python3 to compute F(40)?.
Testing
Use the time module (import time) to track the time it takes for a function to execute.
import time
start_time = time.time()
...
end_time = time.time()
elapsed_time = end_time - start_time # This is in seconds.
Call your two functions and measure time it takes for your code to complete. With F(40) I get the
following output:
andres@lab-vm: / Documents/assignment$ python3
assignment-3.py
Naive time: 34.00093603134155 sec
Memo time : 3.5762786865234375e-05 sec
Write the corresponding code to print your results.
Note
Beyond F(40) the time for the nave approach increases drastically.
On visual studios code Lab Assignment 3 In this

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!