CsharpInterviewQuestions icon indicating copy to clipboard operation
CsharpInterviewQuestions copied to clipboard

Added the Fibonacci Solution with Dynamic programmng

Open mfullen opened this issue 7 years ago • 1 comments

Hello,

I wanted to add an alternate solution to the Fibonacci problem because recursion in this problem when you start to choose n at higher numbers like 50, 100 or even greater becomes unstable due to recursion being very inefficient. In fact depending on your computer's memory you may very easily run into overflow issues at a much smaller number.

The dynamic programming approach removes recursion altogether and has a much faster calculation time. I included a stop watch of both methods to illustrate the difference.

I also think Dynamic Programming is relevant because it is a commonly asked interview question type.

Good job so far and good luck.

Thanks!

mfullen avatar Mar 26 '18 16:03 mfullen

Thanks for your addition @mfullen it will be added soon.

geralexgr avatar Mar 26 '18 19:03 geralexgr