|
Post by Bahamut on Feb 19, 2002 20:59:24 GMT -5
It says that TwoEndedLinkedList is supposed to have a method Iterator iterator() that returns an insance of the iterator. This doesn't make any sense to me. What are you supposed to return if TwoEndedLinkedList doesn't even have an iterator? Even if it did it still wouldn't make any sense. I could understand if it wanted us to return the head and carry on from there, but return an ITERATOR? Can somebody clear this up? I can't even start the bloody assignment because of this problem.
|
|
|
Post by Brutal_Chicken on Feb 19, 2002 22:02:52 GMT -5
So TwoEndedWhatever implements Iterator? Nah, that doesn't make sense... All you have to do is make a public Iterator iterator() method that makes an instance of LinkedListIterator and returns it (I suggest making a method/constructor with a Node parameter). And for that all you need is to start from Node head and stop at Node tail.
Start with modifying A1... that took me most of today! Damned 'style' my butt!
EDIT: Can't we make this a bit easier and pass along both head and tail as parameters in the constructor? Then all you have to do then is compare the next element to tail.
|
|
|
Post by Bahamut on Feb 21, 2002 18:28:53 GMT -5
Thanks, man. I'm finished the assignment! Well, practically: all I gotta do now is swap() and I have a good idea on how to do it. 8)
EDIT: It worked. 8)
|
|