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
Song
class that has instance fields for title (a string), and time (int), which implements theComparable
interface using theString
title
. Write aSongSorter
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 3int
instance variables, that implements theComparable
interface, and overrides thetoString()
method so it looks like 12/25/2015 when you print a date. Next writeDateSorter
that has the methodsselectionSort
that callsgetMin(int fromIndex)
andswap(int a, int b)