1. Write an iterative and a recursive version of the Fibonacci series algorithm. You need to ensure the correctness of the both algorithms. Both algorithms should produce similar output if given a similar input.
a. Measure the performance of the two algorithms by measuring the time for both algorithms to listing out 10, 20, 30, 40, 50, 60, 70 and 80 of Fibonacci numbers. The listing procedure could be done with a loop. For each test, repeat 3 times and get the average value.
1) you can find code for this most anywhere. What do you have so far?
a) this depends heavily on the particular code you have... post it and we can start discussing.
Hint: we don't do homework for people, so you have to meet us half way by producing some code.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks