Question: computer science
Objective:Work with hash tables by creating a hash table using linear probing. I need this code in java. "LinearProbingHashTable.java"
Description:Create a generic class called LinearProbingHashTable<K,V>.
It should contain a private static class, Entry<K,V>. Because Java cannot create an array of a generic class, create the array for the table like this: Entry<K,V> table; // declare generic table = new Entry[size]; // create as non-generic Note that this will generate a warning message when compiled. Your class should have the following methods. The methods should all operate on the object making the call (none are static). Perform checking of the parameters and throw exceptions where appropriate.
a) public boolean insert(K key, V value) inserts entry, rehashes if half full, can re-use deleted entries, throws exception if key is null, returns true if inserted, false if duplicate.
b) public V find(K key) returns value for key, or null if not found
c) public boolean delete(K key) marks the entry deleted but leaves it there, returns true if deleted, false if not found
d) private void rehash( ) doubles the table size, hashes everything to the new table, omitting items marked deleted
e) public static void main(String args) demonstrate each of your methods