Study Guide For Chapter 5 Test
The Topics from Chapter 5 Include:
- 5.1 (pp. 95-103) Iterations, Max and Min, swap, inset in order, loop invariants
- 5.2(pp. 103- 105) Search Algorithms: sequential and binary
- 5.3 (pp. 106-108)
- 5.4(pp 108-113) Recursion
- 5.5 Merge Sort
- 5.6 Data Organization
- Phone Book Video and Lab
- Make a
Songclass that has instance fields for title (a string), and time (int), which implements theComparableinterface using theStringtitle. Write aSongSorterthat 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
Dateclass with 3intinstance variables, that implements theComparableinterface, and overrides thetoString()method so it looks like 12/25/2015 when you print a date. Next writeDateSorterthat has the methodsselectionSortthat callsgetMin(int fromIndex)andswap(int a, int b)
