Skip to content

This is a simple demonstration on how recursive algorithms may not scale when input increase and how we can use dynamic programming (memoization) to improve performance.

Notifications You must be signed in to change notification settings

dancosta/fibonaccidemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Fibonacci demonstration

This is a simple demonstration on how recursive algorithms may not scale when input increase and how we can use dynamic programming (memoization) to improve performance

There is an interface called Fibonacci and two implementing algorithms, one uses the classic recursive approach, the second one uses an ArrayList to store previous calculations and iterate over it in a linear loop.

It is provided a simple test case for each implementation, with the same inputs, and it is calculated the amount of time for executing them.

For this demonstration was calculated fibonacci of 50, which takes more than one minute for the recursive approach and less than a millisecond for the other approach.


If you liked this project, plesase live a ★ =). It will motivate me to improve this project further.
Feel free to open issues, even for questions!

About

This is a simple demonstration on how recursive algorithms may not scale when input increase and how we can use dynamic programming (memoization) to improve performance.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages