comp.lang.ada
 help / color / mirror / Atom feed
* Re: problem - linked lists for beginners
       [not found] <01bd4455$7a3f0020$ef0ccfc2@grat.softnet.co.uk>
@ 1998-03-02  0:00 ` John Herro
  0 siblings, 0 replies; only message in thread
From: John Herro @ 1998-03-02  0:00 UTC (permalink / raw)



"Sean kenny" <SeanKenny@grat.softnet.co.uk> wrote:
> I'm trying to write a procedure that
> will add integers to a set.  I want to
> set the set up as a linked list. ...
> So what do I do if this is the first
> element to be added to a null set
> ie. the first element of the linked list.

NOTE: I tried to reply directly to Sean, but the e-mail bounced, so I'm
replying to the group:

     The easiest way to simplify the code for a linked list is to have one
extra (unused) link at the head of the list.  This greatly simplifies the code
that adds an element to the list, because adding a link at the head of the list
is no longer a special case.
     You'll find an example, with the code, in the shareware Ada Tutor program,
which you can download at http://members.aol.com/AdaTutor, or at
ftp://members.aol.com/ in the directory AdaTutor.  I hope this helps.
- John Herro




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-03-02  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <01bd4455$7a3f0020$ef0ccfc2@grat.softnet.co.uk>
1998-03-02  0:00 ` problem - linked lists for beginners John Herro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox