Examine the recursive function computation of fibonacci


Problem

In this exercise you will compare the efficiency of a recursive and an iterative function to compute the Fibonacci number.

a. Examine the recursive function computation of Fibonacci numbers. Note that each Fibonacci number is recomputed many times. To avoid this recomputation, do programming problem 1 iteratively, rather than recursively; that is, do the problem with a loop. You should compute each Fibonacci number once on the way to the number requested and discard the numbers when they are no longer needed.

b. Time the solution for project 1 and part a of this project in finding the 1st, 3rd, 5th, 7th, 9th, 11th, 13th, and 15th Fibonacci numbers. Determine how long each function takes. Compare and comment on your results.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Examine the recursive function computation of fibonacci
Reference No:- TGS02746699

Expected delivery within 24 Hours