From: seth AT kansmen DOT com (Seth Jones) Newsgroups: comp.lang.c++,comp.os.msdos.djgpp,comp.programming Subject: Re: Question: Linked lists and classes: Self initiation Message-ID: References: <3720BE52 DOT 6E86A8C4 AT xoommail DOT com> <3720D21C DOT 9617323B AT atlantis DOT stortek DOT com> <37213049 DOT 1471831 AT news-server> Organization: Kansmen X-Newsreader: MicroPlanet Gravity v2.10 Lines: 30 Date: Mon, 26 Apr 1999 18:45:01 GMT NNTP-Posting-Host: 38.170.72.106 NNTP-Posting-Date: Mon, 26 Apr 1999 14:45:01 EDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com In article <37213049 DOT 1471831 AT news-server>, -Gadget-nospam- @vic.bigpond.net.au says... > A linked list is an iterative structure, not a recursive one. > A tree structure is recursive. You've never programmed in LISP, have you? The typical C++ definition of a linked list is something like struct node { type value; node *next; }; If that's not a recursive definition, I don't know what is. In fact it is _also_ an iterative structure, because iteration and tail- recursion are functionally equivalent. > As was mentioned earlier, this makes an interesting stunt (stunt?!), > but is a bit like peeling oranges with a potato peeler. There are much > better and more efficient ways, so why make life difficult. > You wouldn't rewrite the code 'for (n=0 ; n<100; n++)' as a recursive > routine... or would you? Only if I was rewriting it in LISP, or some other functional language. C++ generally handles iteration more efficiently than recursion (I think I mentioned that before). Seth Jones