Item Hash code Ellie 1324606073 John 278195619 Sarah 1460449349 David 437601659 Karen 1290184204 Ronald 1306975744 Tom 2125355666 Tim 673057863 Mike 1334117090 Josh 1460128455 Table Continues On Next Page Hashing Assignment CSC 385 Claire 31303215 Marin 764701412

New Perspectives on HTML5, CSS3, and JavaScript
6th Edition
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Patrick M. Carey
Chapter7: Designing A Web Form: Creating A Survey Form
Section7.1: Visual Overview: Structure Of A Web Form
Problem 2QC
icon
Related questions
Question
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 hash 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 1460128455
 
 
Item
Hash code
Ellie
1324606073
John
278195619
Sarah
1460449349
David
437601659
Karen
1290184204
Ronald
1306975744
Tom
2125355666
Tim
673057863
Mike
1334117090
Josh
1460128455
Table Continues On Next Page
Hashing Assignment
CSC 385
Claire
31303215
Marin
764701412
Transcribed Image Text:Item Hash code Ellie 1324606073 John 278195619 Sarah 1460449349 David 437601659 Karen 1290184204 Ronald 1306975744 Tom 2125355666 Tim 673057863 Mike 1334117090 Josh 1460128455 Table Continues On Next Page Hashing Assignment CSC 385 Claire 31303215 Marin 764701412
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning