{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

labtasks_01 - 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 1 Submission: Provide the following classes, transfer them to sunfire and call /home/course/cs1102s/bin/submit as in Assignment 3. CheckBalanced.java MyArrayQueue.java MyArrayListWithReverse.java MyTwoStacksArray.java During testing, do not modify the interfaces provided in the given Eclipse project! 1. Exercise 3.16, page 97: Download the assignment project from http://www.comp.nus.edu.sg/ cs1102s/java/labtasks 01.zip . Complete the class reverseIterator .MyArrayListWithReverse.java. The given program MyArrayList.java 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 balancing.CheckBalanced.java. 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 twoStacks.MyTwoStacksArray.java. 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 queues.MyArrayQueue.java. 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online