The message below is being cross-posted from the LogoForum. Please
reply here at comp.lang.logo and it will be cross-posted back to the
LogoForum. The original author of this message is
pavel@[EMAIL PROTECTED]
wrote:
> --- In LogoForum@[EMAIL PROTECTED]
"jotape1960" <jotape1960@[EMAIL PROTECTED]
> wrote:
> Too many iteration-loving Comp-Sci types still disparage recursion,
> and languages which either support or promote recursion.
May be it is also a matter of personal preferences and a matter how data
are represented (i.e. the algorithm is not the only factor!).
For example, for linear iteration over an array I'd prefer to use REPEAT
or FOR (or WHILE if the number of iterations is unknown in advance).
However, for non-linear iteration, like traversing a tree or a graph,
I'd definitely prefer a recursive approach.
There are also heterogeneous loops. The parsing phase of Lhogho (and
Elica) uses both recursion and iteration; and they are interlaced.
I'm curious as to what is the situation if we go outside Logo and CS. Is
the Nature recursive or iterative by nature? Or maybe it is both of
them? Or none? Is DNA replication pure linear iteration? What are
fractals? While looking at a Mandelbrot fractal the image appears to be
recursive, while the drawing algorithm is purely iterative. A mountain
skyline looks chaotic, but can be generated recursively.
Pavel
__._,_.___
LogoForum messages are archived at:
http://groups.yahoo.com/group/LogoForum