A recursive function to calculate the fibonacci numbers was


Question: A recursive function to calculate the Fibonacci numbers was presented in this chapter. However, each time a number was calculated, it recalculated previous Fibonacci numbers. Refactor your recursive function to retain previous, already calculated Fibonacci numbers and reference them instead of recalculating them. A list could be used, but a dictionary works better. The name for this technique is "memoization."

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: A recursive function to calculate the fibonacci numbers was
Reference No:- TGS02478838

Now Priced at $15 (50% Discount)

Recommended (96%)

Rated (4.8/5)