Implementing Memoization for Recursive Fibonacci in Python // #Shorts

preview_player
Показать описание
In the previous videos, we saw how ridiculously slow our naive Fibonacci function implementation was.

In this video, we use memoization to speed it up dramatically!

This is the end of this quick series examining recursive fibonacci, I hope you enjoyed it!

--

Trying out this short-form video style now that YouTube has #Shorts!

Don't worry, I will still be posting my normal longer DevOps and Cloud Infrastructure content, but I figured it would be fun to put together some quick ones like this too.

---
Join the Community:
Рекомендации по теме
Комментарии
Автор

The return statement should not have `memo`. It should remain as `return (value, count + 1)`.

hwx
Автор

I wrote your code and got this error:
Traceback (most recent call last):
File "D:/Coding/Python/Others/fibfast.py", line 21, in <module>
fib_i, count = fib(i)
ValueError: too many values to unpack (expected 2)
Is the problem with my system?

amirrezaamiri