home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!darwin.sura.net!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!nucsrl!ddsw1!infopls!rhps!burch
- From: burch@rhps.chi.il.us (Lee Burch)
- Newsgroups: comp.lang.c
- Subject: Re: To Recurse or NOT to recurse?
- Message-ID: <8NN1TB2w165w@rhps.chi.il.us>
- Date: Tue, 10 Nov 92 03:17:42 CST
- References: <1992Nov6.185136.8055@netcom.com>
- Organization: CrissySoft Incorporated
- Lines: 20
-
- sjs@netcom.com (Stephen Schow) writes:
-
- > What is better to do when traversing a linked list..... SHould I use recursio
- > to search down through the list for the last node, or should I use a while
- > loop? What or the pro's and con's of each?
- >
- > Thanks in advance
- > --
- I don't mean to cut you down, but, you have not been at this
- long have you...
-
- the overhead of making a subroutine call is actually quite high
- under C, i is much faster and much perfered to use a while loop.
-
- the only advantage of recursion is it is easier to understand
- and write than itterative mentohds.
-
- -- Lee Burch
-
-
-