home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.programming
- Path: sparky!uunet!caen!uwm.edu!csd4.csd.uwm.edu!markh
- From: markh@csd4.csd.uwm.edu (Mark)
- Subject: Re: Teaching the basics
- Message-ID: <1992Aug26.175824.29871@uwm.edu>
- Sender: news@uwm.edu (USENET News System)
- Organization: Computing Services Division, University of Wisconsin - Milwaukee
- References: <7116@charon.cwi.nl> <1992Aug25.174243.10436@uwm.edu> <BtJyAM.MGv@cs.psu.edu>
- Date: Wed, 26 Aug 1992 17:58:24 GMT
- Lines: 12
-
- In article <BtJyAM.MGv@cs.psu.edu> schwartz@roke.cs.psu.edu (Scott Schwartz) writes:
- >markh@csd4.csd.uwm.edu (Mark) writes:
- > Wrong. In fact, the non-recursive version (tree search) is far smaller and
- > simpler. No stacks either.
- >
- >Actually, the search algorithm is tail recursive, so you can code it
- >in the straightforward (recursive) way and let the compiler generate
- >the iterative code. Gcc and Sun's CC do this.
-
- Non recursive tree traversal was also illustrated in the article you quoted,
- with all 6 modes combined in one short routine. No compiler will generate
- anything close to that, much less try to combine all 6 ways into one.
-