Assign2 - CSE2011F06/HR Assignment#2 Due Oct 11 06 Linear Structures and Randomized Algorithms 1 Answer the following questions about the classes

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

View Full Document Right Arrow Icon
CSE2011F06/HR - Assignment #2 - Due Oct. 11, 06 Linear Structures and Randomized Algorithms 1. Answer the following questions about the classes MyArrayList and MyLinkedList which were discussed in class and in the textbook. a. Is the iterator of MyArrayList fail-fast? If not, make it so. b. Analyze the worst-case running time of the add(<AnyType>) method of MyLinkedList . Note that this method invokes a chain of methods. c. Provide an amortized analysis of the add(<AnyType>) method of MyArrayList . d. Add the following method to MyLinkedList and give its running time. Its postcondition is that all elements in the passed collection are removed from this list if present: public void removeAll(Iterable<? extends AnyType> items) e. Use either of these two classes and the adapter design pattern to implement a queue. Analyze the running time of enqueue and dequeue in the resulting implementation. 2. In this adaptation of a recent SIGCSE paper (
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/11/2010 for the course CSE CSE 2011 taught by Professor Neugyen during the Fall '09 term at York University.

Ask a homework question - tutors are online