Question: Assume you have a HashMap class that uses a threshold of 0 . 7 5 ( 7 5 % ) , regardless of the collision
Assume you have a HashMap class that uses a threshold of regardless of the collision resolution mechanism used, and has an initial array size of You may assume the array is resized when the current item to be added will make the load factor greater than or equal to the threshold. Recall that the load factor is the fraction of a hash
Table Continues On Next Page
map that is full. If the array is to be resized, assume the array doubles in size and adds one size
Table contains a list of items and their associated hash codes that were computed with some
hypothetical hash function. Assume the items are added to a newly created instance of the HashMap class in the same order in which they are listed in the table. Based on this information, show what the array of the HashMap would look like after all the items have been added using both of the following
hash collision resolution techniques.
Separate chaining
linear probing
Provide arraysone for each problem One that uses separate chaining
and another that uses linear probing. Keep in mind as well that you do not need to compute the hash
codes as they are given to you. The hash codes in the following table are given as integer values.
Item Hash code
Ellie
John
Sarah
David
Karen
Ronald
Tom
Tim
Mike
Josh
Table Continues On Next Page
lashing Assignment
SC
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
