Question: 3. Write an efficient iterative (1.e., loop-based) algorithm Fibonacci(n) that returns the nth Fibonacci number. Your algorithm may only use a constant amount of memory

3. Write an efficient iterative (1.e., loop-based) algorithm Fibonacci(n) that returns the nth Fibonacci number. Your algorithm may only use a constant amount of memory (1.e., no auxiliary array). Argue that the running time T(n) of the algorithm is linear in n, i.e., T(n) Scn for some constant c
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
