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. (a) The running time is O( N^2 ) because of the two nested loops. (b) For an O( N^2 ) algorithm, double the input means 4 (2*2) times as long to run. So, it takes 32 milliseconds. (c) Insert the items into a Set. The for each item, x, check if sum-x is in the Set by calling contains. The cost is N times the cost of a basic Set operation, or O(N log N) for a TreeSet. Alternate is to use Arrays.Sort to mergesort the items in O(N log N) time and then do binary searches instead of contains. (d) Removing the requirement does not make the problem any easier, because that part of the problem is only O(N). 2. (a) // Runs in O(N) time public int size( ) { int theSize = 0; for( Node p = beginMarker; p.next != endMarker; p = p.next ) theSize++; return theSize; } (b) public void remove( Node p ) { p.next.prev = p.prev; p.prev.next = p.next; } (c) public void removeFirst( ) { if( isEmpty( ) ) throw new NoSuchElementException( ); remove( beginMarker.next ); } 3. public static List getCourses( Map m, String student ) { return (List) m.get( student ); } public static List getStudents( Map m, String course ) { List result = new ArrayList( ); Iterator itr = m.entrySet( ).iterator( ); while( itr.hasNext( ) ) { Map.Entry thisEntry = (Map.Entry) itr.next( ); Object thisStudent = thisEntry.getKey( ); List thisCourseList = (List) thisEntry.getValue( ); if( thisCourseList.contains( course ) ) result.add( thisStudent ); } return result; } 4. private static boolean containsSum( int [ ] arr, int low, int high, int sum ) { if( low > high ) return sum == 0; // empty base case sequence true only if sum is 0 return containsSum( arr, low + 1, high, sum ) || containsSum( arr, low + 1, high, sum - arr[ low ] ); }