Question: Write a short program to test it. The input of this program must be a positive integer n; the output is the corresponding Fibonacci number

Write a short program to test it. The input of this program must be a positive integer n; the output is the corresponding Fibonacci number F(n). (B) [20 points] Write an iterative function to calculate Fibonacci numbers. Write a test driver for it. The input of this program must be a positive integer n; the output is the corresponding Fibonacci number F(n). (C) [10 points] Write a program that will compare running time of the recursive and iterative functions for calculating Fibonacci numbers. Call each function for the same size of input n and find their running times. For part (D) of this project you will have to run this program multiple times to find out how the running time of each function depends on the value of n. (D) 20 points] This part of the project is a written analysis of two algorithms of calculating Fibonacci numbers: recursive (part A) and iterative (part B). Show the theoretical order of growth of the running time for both algorithms. Then include experimental results based on part (C) and explain them
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
