📜  最有效的斐波那契数算法 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:10.738000             🧑  作者: Mango

代码示例2
>>> def fib(n, computed = {0: 0, 1: 1}):
...     if n not in computed:
...         computed[n] = fib(n-1, computed) + fib(n-2, computed)
...     return computed[n]