Question: Objective: Work with hash tables by creating a hash table using linear probing. Description Create a generic class called Line ProbingHashTable It should contain a

Objective: Work with hash tables by creating a hash table using linear probing.

Objective: Work with hash tables by creating a hash table using linearprobing. Description Create a generic class called Line ProbingHashTable It should contain

Description Create a generic class called Line ProbingHashTable It should contain a private static class, Entry V Because Java cannot create an array of a generic class create the array for the table like this: Entry table declare generic table new Entry Ze 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 You may use code from the textbook, but all other code must be your own. 5 points a) public bool ea insert (K key, V value) n inserts entry rehashes if half full, can re-use deleted entries, throws exception if key is null, returns true if inserted, false if duplicate 5 points b) public V ind (K key) returns value for key, or null if not found 15 points c) public bool ea delete (K key) marks the entry deleted but leaves it there, returns true if deleted, false if not found 5 points d) private void rehash doubles the table size, hashes everything to the new table, omitting items marked deleted 10 points e) public int get hvalu (K key) returns the hash value for the given key, or -1 if not found. (this is the value before probing occurs) 10 points f) public int getLocation (K key) returns the location for the given key, or -1 if not found. (this is the value after probing occurs)

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!