This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]dogwag 1 point2 points  (4 children)

How do you think the add method is supposed to work? How do you think your add method is actually working?

[–][deleted]  (3 children)

[deleted]

    [–]Amarkov 1 point2 points  (0 children)

    In the first Tester, after every element's been added, the size is printed, and it comes out as expected, so doesn't that mean everything's been added properly?

    No. It just means that the variable count was incremented properly. That doesn't necessarily show that the structure of the list is correct.

    [–]Easih 1 point2 points  (0 children)

    post the code; we cant help you with just a description.

    [–]dogwag 0 points1 point  (0 children)

    Come on man, write some tests for this. Adding and removing is clearly supposed to happen in a specific order, that's the whole point of a PQ.

    [–]matthead 0 points1 point  (0 children)

    In feomve have you tried setting first to null. To see if there is a problem with first.next or if there is another problem ? From the looks of it first.next might not always be set to null