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=0.7 required=5.0 tests=BAYES_00,LOTS_OF_MONEY, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a676349b69fa778f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-12 07:11:56 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!falcon.america.net!sunqbc.risq.qc.ca!newsfeed.mathworks.com!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Ted Dennison Newsgroups: comp.lang.ada Subject: Re: Help: my list adt is broken Date: Mon, 12 Feb 2001 14:55:18 GMT Organization: Deja.com Message-ID: <968tgh$358$1@nnrp1.deja.com> References: <5aDh6.11952$BQ3.215984@news6-win.server.ntlworld.com> NNTP-Posting-Host: 204.48.27.130 X-Article-Creation-Date: Mon Feb 12 14:55:18 2001 GMT X-Http-User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; 0.7) Gecko/20010109 X-Http-Proxy: 1.0 x73.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 X-MyDeja-Info: XMYDJUIDtedennison Xref: supernews.google.com comp.lang.ada:5165 Date: 2001-02-12T14:55:18+00:00 List-Id: In article <5aDh6.11952$BQ3.215984@news6-win.server.ntlworld.com>, "chris.danx" wrote: > i seem to have a problem with my (doubly) linked list ADT, and i can't > figure out what's wrong. ... > i think the problem occurs when removing the tail. it doesn't seem to > be erased but it should be. i know > it's removed one from the size variable, so the code should be > executed in full. I don't see anything obviously wrong in the routine you posted, but its tough to tell since there's no indication as to what the types you are using are, or how the fundamental algorithms you are using are written. If I had to take a wild guess, I'd say that your logic for setting up the ".prev" links is bad, since that could cause what you are seeing, and the stuff that *is* working doesn't seem to use those .prev links (but again, that isn't shown here). One debugging trick I often find useful for data structures is to get out a pencil and a piece of paper (or a whiteboard) and run through the source code like I'm the computer. Data elements can be represented as boxes, and link fields can be represented by drawing arrows between the boxes. -- T.E.D. http://www.telepath.com/~dennison/Ted/TED.html Sent via Deja.com http://www.deja.com/