This is the prompt for the programming assignment that was given in class:
- Implement both the recursive and the DP algorithms to calculate a specific Fibonacci number n (n >= 0). For any input of n from the user, both algorithms should return the correct result. For example, F(0) = 1; F(1) = 1; F(5) = 8; etc.
- The program will first ask the user to select the recursive algorithm or the DP algorithm; then ask the user input of n; finally display the result of F(n); the program will keep waiting for the user selection until the user chooses to exit.
- Fill out the following spreadsheet (named Fibonacci_Time.xls(x) or Fibonacci_Time.csv).
This is how the code is ran: The code is run by allowing the user to choose between two different algorithms, it then allows the user to select the size of the array, the algorithm is then run and provides the time it took for each algorithm and the results are then printed on a csv file.