Skip to content

This project implements recursive and dynamic programming (DP) algorithms to compute Fibonacci numbers. Users can select an algorithm, input a Fibonacci index n, and view the result and execution time, which is recorded in a CSV file.

Notifications You must be signed in to change notification settings

PrincetonE123/Recursive-vs-Dynamic-Programming-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Recursive-vs-Dynamic-Programming-Algorithm

This is the prompt for the programming assignment that was given in class:

  1. 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.
  2. 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.
  3. 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.

About

This project implements recursive and dynamic programming (DP) algorithms to compute Fibonacci numbers. Users can select an algorithm, input a Fibonacci index n, and view the result and execution time, which is recorded in a CSV file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published