Question: objective: Work with hash tables by creating a hash table using linear probing Description: Create a generic class called LinearProbingHashTablecK,> It should contain a private

 objective: Work with hash tables by creating a hash table using

objective: Work with hash tables by creating a hash table using linear probing Description: Create a generic class called LinearProbingHashTablecK,> It should contain a private static class, Entry Because Java cannot create an array of a generic class, create the array for the table 1ike this: EntrycK, v> table / declare generic table new Entrytsize]: / 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 cal1 (none are static) Perform checking of the parameters and throw exceptions where appropriate You may use code from the textbook, but all other code must be your own. 15 points 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 15 points b) public v find(K key) returns value for key, or null if not found 15 points c) public boolean delete(K key) marks the entry deleted but leaves it there, returns true if deleted, false if not found 15 points d) private void rehash( doubles the table size, hashes everything to the new table, omitting items marked deleted 10 points e) public int getHashvalue(K key) returns the hash value for the given key (this is the value before probing occurs) 10 points f) public int getlocation( key) returns the location for the given key or -1 if not found (this is the value after probing occurs) 10 points g} public String toString returns a formatted string of the hash table, where k, v is the key and value at this location: 0 k,v 2 k, v deleted 10 points h) public static void main(String args ]) demonstrate each of your methods

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!