Implement the NewTable class from Section 11.5.A New Table ClassWe

Implement the NewTable class from Section 11.5.


A New Table Class
We have implemented hash tables with an array of records (for open-address hashing) and an array of linked lists (for chained hashing). The goal of this section is to implement a new version of a chained hash table by using existing collection classes from the Java Class Libraries. The new class, called NewTable, has the advantage of being able to easily access and modify data items using the methods and iterators of the underlying collection classes. A second advantage is that we no longer need to worry about the fact that Java forbids arrays of generic elements, because we’ll never need such an array! Instead, we’ll use the Java generic collection classes—and whoever implemented those classes can worry about the generic array problems.