Study Guide For Chapter 5 Test

The Topics from Chapter 5 Include:

  1. 5.1 (pp. 95-103) Iterations, Max and Min, swap, inset in order, loop invariants
  2. 5.2(pp. 103- 105) Search Algorithms: sequential and binary
  3. 5.3 (pp. 106-108)
  4. 5.4(pp 108-113) Recursion
  5. 5.5 Merge Sort
  6. 5.6 Data Organization
  • Phone Book Video and Lab
  • Make a Song class that has instance fields for title (a string), and time (int), which implements the Comparable interface using the String title. Write a SongSorter that sorts and ArrayList of Song according to the the running time, and use a linear search to find the longest song and returning the title of the longest song.
  • Make a Date class with 3 int instance variables, that implements the Comparable interface, and overrides the toString() method so it looks like 12/25/2015 when you print a date. Next write DateSorter that has the methods selectionSort that calls getMin(int fromIndex) and swap(int a, int b)