Inefficient Recursion: Fibonacci Numbers
Let’s study a scenario where recursion introduces inefficiency by repeatedly calculating the same value.
We'll cover the following...
Inefficient recursion
Here is another classic example of recursion – calculating the Fibonacci number. It turns out that this is hopelessly inefficient using pure recursion, but we will also look at a useful technique to alleviate the problem.
If you are not familiar with the Fibonacci series, it is an infinite series of numbers defined as follows:
= 0
= 1
= ...
Access this course and 1400+ top-rated courses and projects.