Here is a quick sketch of the solutions. In grading, I am looking only for a few things on each question, and an overall understanding of the important concepts. VERSION A 1. [SCORING BY PARTS: 10; 15; 10; 15] a. get an ArrayList is an O(1) There are N gets, so the total cost is O(N). b. get from a LinkedList is an O(N) operation so the total cost is O(N^2). c. For a quadratic algorithm, 10 times the input means 100 times the running time. So you could use a 10,000 item list (10x as large) and have the running time increase from 10 to 1000 milliseconds (100x). d. public static int sum( List list ) { int result = 0; Iterator itr = list.iterator( ); while( itr.hasNext( ) ) { result += itr.next( ); if( itr.hasNext( ) ) itr.next( ); } return result; } 2. [SCORING BY PARTS: 20 for toString; 10 for Big-Oh; 20 for remove] [Missing p!null in toString -5; not using StringBuffer -5] [Main code in removeFirst is 12 pts; 4 for handling case of last item removed; 4 for empty] a. public String toString( ) // Runs in O(N) { StringBuffer result = new StringBuffer( "[ " ); for( Node p = first; p != null; p = p.next ) result.append( p.data + " " ); result.append( "]" ); return result.toString( ); } b. public void removeFirst( ) { if( first == null ) throw new IllegalOperationException( ); if( first == last ) first = last = null; else { first = first.next; first.previous = null; } } 3. [SCORING: 15 points for declaration of map, 20 points to ] [ populate map, 15 points to dump map back into array ] public void sort( String [ ] arr ) { Map m = new TreeMap( ); for( String s : arr ) { Integer count = m.get( s ); if( count == null ) m.put( s, 1 ); else m.put( s, count + 1 ); } int idx = 0; for( Map.Entry e : m.entrySet( ) ) { String word = e.getKey( ); int occurrences = e.getValue( ); for( int i = 0; i < occurrences; i++ ) arr[ idx++ ] = word; } } 4. public static double [ ] findMaxAndMin( double [ ] arr ) { return findMaxAndMin( arr, 0, arr.length - 1 ); } private static double [ ] findMaxAndMin( double [ ] arr, int low, int high ) { if( low + 1 >= high ) return new double [ ] { max( arr[ low ], arr[ high ] ), min( arr[ low ], arr[ high ] ) }; int mid = ( low + high ) / 2; if( isOdd( mid - low + 1 ) && isOdd( high - mid ) ) mid++; double [ ] left = findMaxAndMin( arr, low, mid ); double [ ] right = findMaxAndMin( arr, mid + 1, high ); return new double [ ] { max( left[ 0 ], right[ 0 ] ), min( left[ 1 ], right[ 1 ] ) }; }