COMP 2710 Lecture : 140321 - Sets with Iterators - Stacks - Queues.doc

58 views1 pages

Document Summary

Iterator with set stays at teh same position. You can call set multiple times: to different add methods, one for linkedlist and one for iterator same for remove. Set with iterators replace the last element returned by the last call to next() or previous() with the new element: the iterator pointer does not move set() can be called multiple times at the same position. If no next() or previous(), illegalstateexception is thrown at run-time: also set() can not be called right after add() Remove with iterator removes the object that was returned by the last call to next() or previous() Iterator pointer does not move: remove can be called only once after each next() or previous() If removed() is called right after add(), illegalstateexception: must call next() or previous() before remove(), after add()

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions