Fibonacci sequence by recursive algorithm fail
|
10-04-2015, 05:33 AM
Post: #21
|
|||
|
|||
RE: Fibonacci sequence by recursive algorithm fail
Tail recursive version. Runs quick.
Example Run: fibo(400) 284812298108489611757988937681460995615380088782304890986477195645969271404032323901 fibotail(I,J,N):= BEGIN if N>0 then return fibotail(J,I+J,N-1); else return J; end; END; fibo(N):= BEGIN return fibotail(0,1,N); END; |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)