comp.lang.ada
 help / color / mirror / Atom feed
From: johnherro@aol.com (John Herro)
Subject: Re: problem - linked lists for beginners
Date: 1998/03/02
Date: 1998-03-02T00:00:00+00:00	[thread overview]
Message-ID: <19980302142301.JAA08541@ladder02.news.aol.com> (raw)
In-Reply-To: 01bd4455$7a3f0020$ef0ccfc2@grat.softnet.co.uk


"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




           reply	other threads:[~1998-03-02  0:00 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <01bd4455$7a3f0020$ef0ccfc2@grat.softnet.co.uk>]
replies disabled

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