Code from a Rosetta Code Task
H. S. Teoh
hsteoh at quickfur.ath.cx
Thu Aug 29 16:44:39 PDT 2013
On Fri, Aug 30, 2013 at 01:37:39AM +0200, bearophile wrote:
> H. S. Teoh:
>
> >Also, this is a pretty poor algorithm for generating the Fibonacci
> >series,
>
> I know, but you must do what the tasks asks you:
>
> http://rosettacode.org/wiki/Anonymous_recursion
[...]
OK I see.
I wish we could reeducate people that recursive Fibonacci algorithms are
Bad(tm). :) There are better examples of recursion that don't have poor
performance characteristics, or where no better alternative exists. Like
parsing expression trees, for example (even though the parser can be
recursive, it is only linear in the size of the input, so it's not bad).
T
--
I think the conspiracy theorists are out to get us...
More information about the Digitalmars-d-learn
mailing list