Efficient calculation of Fibonacci series
Yes. The primitive recursive solution takes a lot of time. The reason for this is that for each number calculated, it needs to calculate all the previous numbers more than once. Take a look at the following image. It represents calculating Fibonacci(5) with your function. As you can see, it computes the value of Fibonacci(2) … Read more