Skip to content

Graphing the execution times of different Fibonacci algorithms

License

Notifications You must be signed in to change notification settings

mathletedev/fibonacci-times

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

fibonacci-times

Graphing the execution times of different Fibonacci algorithms

Algorithms

Recursive

Time complexity: O(n²)
Uses the classic recursive form of the Fibonacci function,

F(n) = F(n - 1) + F(n - 2)

Iterative

Time complexity: O(n)
Uses two variables to keep track of the two previous values, adding them together each iteration

Logical

Time complexity: O(1)
Uses a variation of Binet's Formula,

F(n) = (φⁿ⁺¹ - (1 - φ)ⁿ⁺¹) / √5

Results

graph

About

Graphing the execution times of different Fibonacci algorithms

Topics

Resources

License

Stars

Watchers

Forks

Languages