home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / programm / 2410 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  2.0 KB

  1. Path: sparky!uunet!gatech!destroyer!ncar!noao!amethyst!organpipe.uug.arizona.edu!news
  2. From: dave@cs.arizona.edu (Dave Schaumann)
  3. Newsgroups: comp.programming
  4. Subject: Recursion (was Re: Teaching the basics)
  5. Message-ID: <1992Aug21.004103.26032@organpipe.uug.arizona.edu>
  6. Date: 21 Aug 92 00:41:03 GMT
  7. References: <1992Aug17.123916.14815@husc13.harvard.edu> <14066@goanna.cs.rmit.oz.au> <1992Aug19.154830.11787@uwm.edu>
  8. Sender: news@organpipe.uug.arizona.edu
  9. Reply-To: dave@cs.arizona.edu (Dave Schaumann)
  10. Organization: University of Arizona
  11. Lines: 32
  12. In-Reply-To: markh@csd4.csd.uwm.edu (Hunk)
  13.  
  14. In article <1992Aug19.154830.11787@uwm.edu>, markh@csd4 (Hunk) writes:
  15. >In article <14066@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
  16. >>If you don't know recursion, you don't know programming.  It is one of the
  17. >>simpler concepts in computing.  (Much simpler than mutable variables, IMHO.)
  18. >
  19. >I think recursion is a farce.  And just to rub it in, here's the Towers of
  20. >Hanoi
  21. [code deleted]
  22.  
  23. So you think recursion is a farce.  Care to explain why?  True, there is
  24. no problem that can be solved without it, but there are many problems
  25. where the solution is naturally modeled by recursion:
  26.  
  27.   -top-down parsing
  28.   -the Akerman function
  29.   -most of the nlogn sort algorithms
  30.   -operations on any recursively defined structure
  31.    o trees (depth-first search is an easy example)
  32.    o lists (check out Lisp)
  33.  
  34. Also, induction is a powerful algorithm design and analysis tool, which
  35. often naturally leads to recursive solutions.
  36.  
  37. If you study recursion, (as in Lisp, for example), you will find that in
  38. many ways, recursion is just another way to iterate.  And certainly,
  39. iteration is a valid and useful tool in programming.
  40.  
  41. -- 
  42. You unlock this door with the key of imagination.  Beyond it is another
  43. dimension: a dimension of sound, a dimension of sight, a dimension of mind.
  44. You're moving into a land of both shadow and substance, of things and ideas.
  45. You've just crossed over into... the Twilight Zone.
  46.