Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions

Question

What are product costs?

Answered: 1 week ago

Question

9.6 Explain what management development is and why it is important.

Answered: 1 week ago

Question

Compare the current team to the ideal team.

Answered: 1 week ago

Question

a. Do team members trust each other?

Answered: 1 week ago