comp.lang.ada
 help / color / mirror / Atom feed
From: Chad R. Meiners <chadmeiners@my-deja.com>
Subject: Re: Help: my list adt is broken
Date: Mon, 12 Feb 2001 00:29:37 GMT
Date: 2001-02-12T00:29:37+00:00	[thread overview]
Message-ID: <967apa$shd$1@nnrp1.deja.com> (raw)
In-Reply-To: 79Dh6.10732$zz4.264993@news2-win.server.ntlworld.com

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/



  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
2001-02-12  0:29 ` Chad R. Meiners [this message]
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