Re: Recursive structure?
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Wed, 09 Aug 2006 20:28:30 GMT
"dspfun" <dspfun@xxxxxxxxxxx> writes:
Morris Dovey wrote:[...]
It's not unusual to see something like:
node *head; /* Pointer to first element */
node *tail; /* Pointer to final element */
or even:
struct
{ node *head;
node *tail;
} mylist;
to provide a "root" for a list.
I'm probably missing something here because I don't see what the
purpose of such a list would be, all it is is a list of node pointers,
isn't it? What is the use of such a list? Wouldn't one like to have
some data at each entry of a list?
Yes, absolutely. A linked list with no actual data isn't much use,
except as a demonstration.
Possibly Morris thought that adding an extra "payload" member would
distract from the main point.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- Follow-Ups:
- Re: Recursive structure?
- From: Morris Dovey
- Re: Recursive structure?
- References:
- Recursive structure?
- From: dspfun
- Re: Recursive structure?
- From: Lew Pitcher
- Re: Recursive structure?
- From: dspfun
- Re: Recursive structure?
- From: Chris Dollin
- Re: Recursive structure?
- From: dspfun
- Re: Recursive structure?
- From: Morris Dovey
- Re: Recursive structure?
- From: dspfun
- Recursive structure?
- Prev by Date: Re: remove dash in ssn with sprintf
- Next by Date: Re: remove dash in ssn with sprintf
- Previous by thread: Re: Recursive structure?
- Next by thread: Re: Recursive structure?
- Index(es):
Relevant Pages
|