comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: Help: my list adt is broken
Date: Mon, 12 Feb 2001 00:29:01 GMT
Date: 2001-02-12T00:29:01+00:00	[thread overview]
Message-ID: <h7Gh6.84123$R5.3887539@news1.frmt1.sfba.home.com> (raw)
In-Reply-To: 79Dh6.10732$zz4.264993@news2-win.server.ntlworld.com

Each list node is pointed to by two things: its successor and its
predecessor.  When you delete an item in mid-list you make two fixes:
         t.prev.next := p.next;
         t.next.prev := p.prev;
But when you delete a head item, or a tail item, you only make one fix.
  The tail error you saw when you traversed the list forward.  The head
error you simply haven't noticed yet since you haven't tried traversing
the list backward.



  parent reply	other threads:[~2001-02-12  0:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-11 21:04 Help: my list adt is broken chris.danx
2001-02-11 23:01 ` Larry Hazel
2001-02-12  0:29 ` tmoran [this message]
2001-02-12  0:29 ` Chad R. Meiners
2001-02-12 12:17 ` chris.danx
2001-02-12 12:50 ` chris.danx
2001-02-12 14:23   ` John English
2001-02-12 15:10     ` chris.danx
2001-02-12 17:33 ` chris.danx
2001-02-12 20:00   ` tmoran
  -- strict thread matches above, loose matches on Subject: below --
2001-02-11 21:05 chris.danx
2001-02-11 21:08 ` chris.danx
2001-02-12 14:55 ` Ted Dennison
2001-02-12 21:14 schwarza
2001-02-12 23:09 ` chris.danx
2001-02-13  1:42   ` Jeffrey Carter
2001-02-13 15:35 schwarza
2001-02-14 11:47 ` John English
replies disabled

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