labtasks_02 - 2 Exercise 3.21(b page 98 Implement class...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab Tasks 2 No submission! Use this lab to check your understanding of queues and stacks. During testing, do not modify the interfaces provided in the given Eclipse project! 1. Exercise 3.16, page 97: Download the assignment project from cs1102s/java/labtasks . Complete the class reverseIterator The given program is taken from the textbook. The iterator function of MyArrayListWithReverse should handle the fol- lowing exceptions: next() throws the exception java. util .NoSuchElementException, remove() throws the exception IllegalStateException if remove() is called without an immediately preceding next(). (You may ignore exceptions arising from concurrent modiFcation java. util .ConcurrentModiFcationException.)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2. Exercise 3.21 (b), page 98: Implement class Note the following facts about Java comments: • When the compiler reads / * , it skips any text until the next character sequence * / (ignore all brackets between these two “tokens”). • When the compiler reads //, it skips any text until the next newline character (ignore all brackets in between). You may assume that the given Java program has no strings. 3. Exercise 3.24, page 98: Implement the class 4. Implement a queue data structure as described in the textbook, using arrays, where the front and back pointers wrap around. When enqueue(. .) is attempted on a queue whose array is full with queue elements, resize the array as with ArrayList. Implement the class 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online