in reply to a better fibonacci subroutine
As of which is better - yours is recursive, his is iterative. You need to use Memoize, he doesn't. You are spending more resources than he is.
The other way round - what makes your version better, apart from "prettiness" (whatever that means)?
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: a better fibonacci subroutine
by apotheon (Deacon) on Dec 15, 2006 at 09:04 UTC |