Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

most efficient fibonacci number algorithm

>>> def fib_to(n):
...     fibs = [0, 1]
...     for i in range(2, n+1):
...         fibs.append(fibs[-1] + fibs[-2])
...     return fibs
...
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #efficient #fibonacci #number #algorithm
ADD COMMENT
Topic
Name
1+8 =