[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LOGO-L> Recursion



I have never heard the terms embedded recursion vs tail recursion.
I am familiar with "tail recursion" as Brian describes it
which is not what you folks are describing.

What you are describing I have studied and it's called
Depth First Search vs Breath First Search in the context
of dealing with traversing information stored in trees.

There are 2 flavors of Depth First Search where you do your
work on the way down the traversion (or recursion) vs on the
way up.

Working with information stored in trees IMHO is one of
the most powerfull applications of recursion. It's used
quite often in A.I. and parsing languages.

Olga Tuzova wrote:
> 
> > Date:          Thu, 19 Mar 1998 07:53:21 -0600
> > To:            "Olga Tuzova" <olgatu@ort.spb.ru>
> > From:          Jim Muller <jmul@cyberramp.net>
> > Subject:       Re: LOGO-L> Recursion
> 
> > Olga ==>
> >
> > You take the fun away (:>)
> >
> > I have found it interesting -- and fun -- to watch the thought processes
> > people of all ages go through to determine the difference between the two
> > procedures.
> 
> How have you managed to do this - watching thought processes?
> 
> I'm very sorry for taking the fun away, but I hope very much, those
> who wanted to get it, have got. I've made a rather long pause.
> 
> But, if you insist, I'll never do such things in future.
> 
> :-)
> Regards,
> Olga.
> 
> >Of course, you have added another challenge. How did Olga make
> > such a great demonstration?
> >
> > Regards...Jim
> >
> > At 03:35 PM 3/19/98 +300, you wrote:
> > >> Date:          Wed, 18 Mar 1998 23:22:47 +1000
> > >> From:          Bill Mackay <wmackay@scu.edu.au>
> > >> To:            logo-l@gsn.org
> > >> Subject:       LOGO-L> Recursion
> > >> Reply-to:      Bill Mackay <wmackay@scu.edu.au>
> > >
> > >> Hello,
> > >> I've just joined the list so maybe this has been covered - but I didn't
> > >> see it in the archives.  Can someone explain when we would use tail
> > >> recursion or embedded recursion? Perhaps an example may suffice.
> > >> Thanks in advance,
> > >> Bill Mackay
> > >
> > >Bill,
> > >
> > >I've never met here html-files with pictures being sent as an
> > >attachment, so I'm not sure it will work well. Nevertheless I'm
> > >trying.
> > >
> > >The attachment contains html-file and two animated pictures of
> > >spirals to demonstrate the difference between tail and embedded
> > >recursion.
> > >
> > >These pictures are just illustrating Jim Muller's MAZE and AMAZE.
> > >You'll see, the behaviour of SPIRAL1 (spiral1a.gif) differs from one
> > >of SPIRAL2 (spiral2a.gif) and the behaviour of SPIRAL2 coinsides
> > >with the one of SPIRAL3.
> > >
> > >TO SPIRAL1 :A
> > >   IF :A<10 [STOP]
> > >   FD :A  RT 90
> > >   SPIRAL1 :A-10
> > >END
> > >
> > >TO SPIRAL2 :A
> > >   IF :A<10 [STOP]
> > >   SPIRAL2 :A-10
> > >   FD :A  RT 90
> > >END
> > >
> > >TO SPIRAL3 :A
> > >   IF :A>100 [STOP]
> > >   FD :A  RT 90
> > >   SPIRAL3 :A+10
> > >END
> > >
> > >All the best,
> > >Olga.
> ---------------------------------------------------------------
> Please post messages to the Logo forum to logo-l@gsn.org.  Mail
> questions about the list administration to logofdn@gsn.org.  To
> unsubscribe send    unsubscribe logo-l    to majordomo@gsn.org.

-- 
===============================================================
George Mills
email: mills@softronix.com
http://www.softronix.com
The www page contains some very powerful educational software.
Our single most important investment is our kids.
---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org.  Mail
questions about the list administration to logofdn@gsn.org.  To
unsubscribe send    unsubscribe logo-l    to majordomo@gsn.org.



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home