Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume you have a HashMap class that uses a load factor of 0.75 (regardless of the collision resolution mechanism used), and has an initial array

image text in transcribed

Assume you have a HashMap class that uses a load factor of 0.75 (regardless of the collision resolution mechanism used), and has an initial array size of 13. The table below contains a list of items, along with associated hashcodes that were computed using 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, answer the following questions 1. (5 points) Show what the array of the HashMap would look like after all the items below have been added, assuming the HashMap class uses separate chaining hashing to resolve collisions, and that the threshold is calculated based on the number of items present, not the number of array cells that contain at least one item. Assume the array is resized when the current item to be added will make the total number of items greater than or equal to the threshold value 2. (5 points) Show what the array of the HashMap would look like after all the items below have been added, assuming the HashMap class uses quadratic probing to resolve collisions instead of separate chaining hashing. Assume the array is resized when the current item to be added will make the total number of items greater than or equal to the threshold value Note that for both questions, you do not need to compute the hashcodes, you only need to determine where the items would be placed into the underlying array of the HashMap Hashcode Item Patriots 1342415383 Steelers 700056533 Chargers 330628742 Texans 532139483 Packers 217142585 49ers Saints 207265348 GiantS 1631149803 2112979549

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual Basic.NET

Authors: Ying Bai

1st Edition

0521712351, 978-0521712354

More Books

Students also viewed these Databases questions