Post Reply 
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)
28481229810848961175798893768146099561538008878230489098647719564596927140403232​3901

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;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Fibonacci sequence by recursive algorithm fail - MikeOShea - 10-04-2015 05:33 AM



User(s) browsing this thread: