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