Reference no: EM132216511
1. Write two separate programs in python that generate the n-th Fibonacci number.
a. The programs should both take n as command line input.
b. The first algorithm one should implement the recursive algorithm, and the second one should implement the iterative algorithm.
c. Measure the time it takes for each of these versions (use for example, the time it module in python) to calculate the n-th Fibonacci number for the following values of n: 1, 5, 10, 15, 20, 25, 30, 35, 40, 41, 42, 43.
d. Create a table of all your results and plot (using for example, the mat plot lib library) the time taken to compute the Fibonacci numbers using recursive and iterative algorithms, with n on the x-axis and time on the y-axis.
2. Prove that the iterative algorithm is in quadratic time. Run the iterative algorithm and record the time on the following values of n: 2^10, 2^12, 2^14, 2^16, 2^18, 2^19 b.Plot the time of the iterative algorithm version