CSC 222: Object-Oriented Programming
Spring 2012

Test 2 Review

TEST 1 MATERIAL Object-oriented design highly cohesive, loosely coupled example: dot race, text vs. visual views Model-View-Controller pattern example: Hunt the Wumpus, text vs. GUI views BlueJ vs. netBeans IDE's Java features data structures ArrayLists vs. arrays parallel lists vs. lists of structured objects exception handling throwing an exception vs. try-catch formatted output System.out.format, format string (e.g., %8s, %-8s, %.2f, %6.2f) enumerated types enum, ENUM_TYPE.VALUE (e.g., CaveContents.EMPTY) interfaces List, Comparable Searching and efficiency sequential search vs. binary search worst case vs. average case vs. best case performance timing performance, System.currentTimeMillis Collections.binarySearch application: Dictionary class, spell checking Big-Oh notation sequential search is O(N), binary search is O(log N) rate-of-growth behavior Sorting and recursion recursion base case(s), recursive case(s) avoiding infinite recursion & redundancies insertion sort vs. selection sort vs. merge sort worst case vs. average case vs. best case performance implementing an O(N) merge Collections.sort application: Dictionary class, lazy add approach Big-Oh analysis insertion & selection sorts are O(N^2), merge sort is O(N log N) recursive analysis formal definition of Big-Oh