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,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-11 16:42:06 PST Path: supernews.google.com!sn-xit-03!supernews.com!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Chad R. Meiners Newsgroups: comp.lang.ada Subject: Re: Help: my list adt is broken Date: Mon, 12 Feb 2001 00:29:37 GMT Organization: Deja.com Message-ID: <967apa$shd$1@nnrp1.deja.com> References: <79Dh6.10732$zz4.264993@news2-win.server.ntlworld.com> NNTP-Posting-Host: 12.109.70.102 X-Article-Creation-Date: Mon Feb 12 00:29:37 2001 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) X-Http-Proxy: 1.0 AGREMPRECISO01, 1.0 x57.deja.com:80 (Squid/1.1.22) for client 12.109.70.102 X-MyDeja-Info: XMYDJUIDchadmeiners Xref: supernews.google.com comp.lang.ada:5135 Date: 2001-02-12T00:29:37+00:00 List-Id: I assume this for a class since writing this ADT is a very common assignment for a second semester university course. I'll give you some advice on debugging. First, you don't provide enough of the information in your test output. You need to look at all of the information in the data structure. You should print out the Head element, tail element and the size each time you change the list data type. Second, you should print out the value of the neighboring nodes or at least whether or not the pointers are null. Another method (if you don't want to write the code to display the above information) would be to desk check your code. Draw a representation of your list and draw the list's representation during each change done by the remove procedure. Using either method should reveal to you that the first call to the remove procedure leaves the ADT in an incorrect state. >i think i've been staring at it too long!!! i'll let someone else >takeover. You should not give up so easily. If you follow the above methods I am sure you should be able to fix your ADT by yourself. Writing correct code requires a good deal of effort and deligence. Gathering all of the data and having a clear understanding of the problem are the most effective methods of preventing yourself from staring at the code until you give up ;) Good Luck, Chad R. Meiners Sent via Deja.com http://www.deja.com/