Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. For the exercises below, assume the closed hash table HI0 6 uses the hash function h(k)-k mod 7 and, for (b) and (c), linear
2. For the exercises below, assume the closed hash table HI0 6 uses the hash function h(k)-k mod 7 and, for (b) and (c), linear probing for collision resolution. (a) What are the approximate expected number of keys that must be inserted into H so that there is a 50% chance of at least one collision and what is the expected number of keys that must be inserted in H so that each slot has at least one key?[10 points] (b) Assuming H is empty, draw the hash table after the insertion of the keys 2, 11, 55, 23, 53, 9 and 61 in the order listed. What is the average number of collisions per key? Give the probe sequence for the insertion of 61 and the number of collisions that occur during its insertion. [10 points] (c) Suppose H is empty and double-hashing is used for collision resolution with the function j(k)k mod 5 used to determine the step size when a collision occurs. Explain why j(k) is a poor choice by giving two integer keys between 1 and 15 inclusive, whose insertion leads to a failure for the second key. [5 points]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started