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 0.75(75%),regardless of the collision resolution mechanism used, and has an initial array size of 13. 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 hashItemHashcodeEllie1324606073John278195619Sarah1460449349David437601659Karen1290184204Ronald1306975744Tom2125355666Tim673057863Mike1334117090Josh1460128455
Table Continues On Next Page
Claire31303215Marin764701412 map that is full. If the array is to be resized, assume the array doubles in size and adds one (2* size +1).
Table 1 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.
1. Separate chaining
2. linear probing
Provide 2 arrays(one 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 1324606073
John 278195619
Sarah 1460449349
David 437601659
Karen 1290184204
Ronald 1306975744
Tom 2125355666
Tim 673057863
Mike 1334117090
Josh 1460128455ItemHashcodeEllie1324606073John278195619Sarah1460449349David437601659Karen1290184204Ronald1306975744Tom2125355666Tim673057863Mike1334117090Josh1460128455
Table Continues On Next Page
lashing Assignment
SC 385
Claire31303215Marin764701412
Assume you have a HashMap class that uses a

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 Programming Questions!