The HashSet<E> and LinkedHashSet<E> Classes The HashSet<E> class implements the Set<E> interface. Since this implementation uses a hash table, it…

Replacing Elements in Collections Both the List<E> interface and the Collections class define a replaceAll() method to replace elements in…

15.10 Sorted Maps and Navigable Maps The SortedMap<K, V> interface extends the Map<K, V> interface, and the NavigableMap<K, V> interface…

16.2 Running Example: The CD Record Class We will use the CD record class and the Genre enum type from…

15.11 The Collections Class The Java Collections Framework also contains two utility classes, Collections and Arrays, that provide various operations…

15.7 Deques In this section we look at deques—that is, linear collections that allow processing of elements from both ends.…

Searching in Arrays A common operation on an array is to search the array for a given element, called the…

15.9 Map Implementations Figure 15.3, p. 787, shows four implementations of the Map<K, V> interface found in the java.util package:…

Searching in Collections The Collections class provides two static methods for finding elements in sorted lists. Click here to view…

15.5 Sorted Sets and Navigable Sets Before reading this subsection, it is a good idea to review the Comparable<E> interface…