Question: Implement a simple hash table that uses quadratic probing in JAVA You can use an array for the hash table * The array should hold
Implement a simple hash table that uses quadratic probing in JAVA
You can use an array for the hash table * The array should hold integer values (the keys) * The keys should be within the range of 100 - 999 * The initial size of the array should be 9
Develop a hashing function that uses quadratic probing * The original hash function should just use the modulus operator to find the position - key mod size * If there is a collision, use quadratic probing to find the next open spot * If the next index is out of range, use a rollover method to continue searching for a spot - For example, if the array only has 9 elements, and the algorithm produces an index of 13, rollover to index 5. - Keep in mind that quadratic probing may not find an open spot. Please remember to incorporate a way to get out of that loop should it happen
The hash table has a load factor of .5 * This should be stored as a constant variable * If the load for the hash table meets or exceeds this value, double the size of the array and rehash everything.
Create a main function to test the hash table * Enter enough values to force the hash table to rehash twice.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
