King Saud University College of Computer and Information Sciences Information Technology Department Second Semester 1433/1434 IT212: Data Structures Due Date: SAT 16/2/2013 (at 8:00 – 12:00 Office 86, Building 20)) 1. Suppose that the ADT list did not have a method replace. Suppose further that nameList is a list of Name objects, where Name is as defined in chapter1. Write a method at the client level that replaces an object in the list nameList. The object’s position in the list is givenPosition and the replacement object is newObject. 2. Implement a method remove (T anObject) for the class LList that removes the first occurrence of a given object from the list. 3. Suppose that you have a list that is created by the following statement: ListInterface<Double> quizScores = new AList<Double>(); Imagine that someone has added to this list the quiz scores received by a student throughout a course. The professor would like to know the average of these quiz scores, ignoring the lowest score. A. Write Java statements at the client level that will find and remove the lowest score in the list. B. Write Java statements at the client level that will compute the average of the scores remaining in the list. 4. Suppose that you want an operation for the ADT list that moves the first item in the list to the end of the list. The header of the method could be as follows: public void moveToEnd() Write an implementation of this method for classes AList and LList. 5. Suppose that a list contains Comparable objects. Implement the following methods for each of the two classes AList and LList. A. The method getMin that returns the smallest object in the list B. The method removeMin that removes and returns the smallest object in the list. 6. Suppose that you want an operation for the ADT list that adds an array of items to the end of the list. The header of the method could be as follows: public void addAll(T[] items) Write an implementation of this method for the class LList. 7. Implement concatenateLists method for class LList that concatenates two lists L and M. The List L will contain all its elements followed by M elements. 8. Write a method getPosition that returns the position of a given object in a list myList. Assume that the object is in the list. A. Write the method getPosition at the client level. B. Write the method getPosition at the implementation level, where myList is implemented using an array. C. Write the method getPosition at the implementation level, where myList is implemented using a chain of nodes.