Question: Java String.hashCode() % iSize (where iSize=100) Part #1 : Design a simple hash table Design a simple hash table that uses linear probing to store
Java

String.hashCode() % iSize (where iSize=100)
Part #1 : Design a simple hash table Design a simple hash table that uses linear probing to store strings. The hash function will just be the length of the string, so "hello" would hash to index position five Make the hash table an array of size ten and populate it with words from short quotes or sentences Test your function against the following quotes 1) fourscore and seven years ago" 2) "jack and jl went up the hill" 3) "happiness depends upon ourselves" (this one will force the search back to the start of the table) Print out the hash table each time to verify it works correctly Sample output shown here original line: [fourscore, and, seven, years, ago] Hash table with Linear Probing: tablel0]: null tableli]: null table[2]: null tablel3]: and tableL4]: ago tableL5]: sever table(6]: years table07]: null table[8]: null tableL9]: fourscore Part #2: Data Collision Your goal in this lab is to count the number of data collisions that occur in a small hash table (size 100) populated with random strings. To generate the strings, use Mathrandom) or javautilRandom to create 100 words" all of the same length (five) consisting of random characters You will use a modified version of the bashCode) function for strings. Since hashCode() returns values that are quite large (over a million) you will need to scale it to a smaller size for this lab. Use the following formula for the hash function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
