Fibonacci sequence by recursive algorithm fail

10042015, 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,N1); else return J; end; END; fibo(N):= BEGIN return fibotail(0,1,N); END; 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)