home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / programm / 2485 < prev    next >
Encoding:
Text File  |  1992-08-26  |  1.1 KB  |  24 lines

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