1. Implement a HashTableFullException by extending Exception.
2. Implement a closed hash table using a second hash
function (hash2 as defined below) as the increment function. You only
need to implement the following methods: int size(), boolean isEmpty(),
V get (K key), V put (K key, V value), and V remove(K key). The methods
that return a value should return null in the special situations as
discussed in class. Your hash table should not rehash, but instead
should throw the HashTableFullException (as implemented in part 1)
when there is possible overflow. Your remove should use the enhanced
Entry class for lazy deletion. Use Integer objects as keys and
anything you like as the data. Use the function hash1 as defined
below for the hash function and hash2 to do the double hashing.
Name your class DHHashTable.
Your bucket array should have size N = 13.
Use the following hash functions:
hash1(k) = k mod 13
hash2(k) = Rev(k +1) mod 11
You will have to write a Rev method that will reverse the decimal
digits of the key, so Rev(37) = 73 and Rev(7) = 7. You can assume
unique, one or two digit integer keys.
3. Implement a driver that will test the hash table you
developed for part 2. Show the user what keys are being inserted,
retrieved or removed. When there is a collision, tell the user the key
that caused the collision and what alternative probes were made. You
should test the following: create items containing these keys:
2,8,31,20,19,18, 53,27. Insert these items in the order given into
the hash table and display the contents of the hash table, including
the index location of each key as well as any collisions that occured.
Retrieve keys, be sure to illustrate collisions and a key not in the
table. Retrieve after deleting. Insert once requiring throwing the
HashTableFullException. Keep the user informed of the contents of the
hash table when the contents change. Name your driver HashTester.
I have attached the files that I got so far.