Yes I'm sure, because I've seen it multiple times used this way, IIRC also in HOP.
The F(n) = F(n-1) + F(n-2) for n > 1 part is straightforwardly implemented with recursion.
> implementing the Fibonacci sequence by recursion is very ineffective.
(Slightly nitpicking) It's inefficient but effective!
The point is you get a correct result, even if you waste processing power.
The "memoisation" you mentioned solves this efficiency problem of needlessly recalculating known results.
IOW, the schoolbook continues evolving the example to deeper depth (sic).
Keep in mind that the classic MIT lectures on programming used to be in Lisp and original Lisp didn't have loops, only those "tail recursions".
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
In reply to Re^4: How am i doing?
by LanX
in thread How am i doing?
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |