From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cda697a71e6bd3d2,start X-Google-Attributes: gid103376,public From: johnherro@aol.com (John Herro) Subject: Re: problem - linked lists for beginners Date: 1998/03/02 Message-ID: <19980302142301.JAA08541@ladder02.news.aol.com>#1/1 X-Deja-AN: 330016243 References: <01bd4455$7a3f0020$ef0ccfc2@grat.softnet.co.uk> X-Admin: news@aol.com Organization: AOL http://www.aol.com Newsgroups: comp.lang.ada Date: 1998-03-02T00:00:00+00:00 List-Id: "Sean kenny" 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