|
Post by Goku on Feb 26, 2002 13:03:52 GMT -5
I created my remove method....and i wanted to test it so i edited the TestTwoEndedLinkedList class. My method looks as follow public Object remove(Object o){ ....etc etc.. } when i test it i wrote System.out.println(list.remove(***)); ***what do i send it to specify which node i want to remove?
|
|
|
Post by Yingster on Feb 26, 2002 15:28:13 GMT -5
doesnt it say to remove the item at a given index, so shouldnt ur method be something like public Object remove (index i){
}
|
|
|
Post by Evotamer on Feb 26, 2002 22:47:48 GMT -5
Why not create a linked list... Print the results of all that... (or the objects if they are strings) Then remove one element.... Then print the results of the list again....
Implentation of that isn't that difficult... If your object isn't a 'string' make some arbitrary 'toString' method to print some sort of ID or something....
I'd give you more info, but doing so would probably give away an answer... but my guidelines should be able to help you.
|
|
|
Post by lordaeron on Feb 27, 2002 3:45:16 GMT -5
Hiya PPl, I just wanted to know something about the removeElement in the TwoEndedlinkedList. Does it have to return an item ?? Can i create a remove and a get element ?? I think it will be less confusing... but, do you think i'll get DINGED ? Thanx ;D ;D ;D ;D
|
|
Poopo
Full Member
Posts: 43
|
Post by Poopo on Feb 27, 2002 8:11:55 GMT -5
It mentions that you can create new methods in TwoEndedLinkedList ... so I "think" if you really wanted too .. you could just make a get method
|
|