Question: We learned about hashing functions in our data structures and algorithms class. I was wondering how to solve this question. Suppose you are given the

 We learned about hashing functions in our data structures and algorithms

We learned about hashing functions in our data structures and algorithms class. I was wondering how to solve this question.

Suppose you are given the following keys: 112;2542;9992;5502 and the following hash function h(x)=xmod10. Hash the keys using the hash function. How many keys collide? Choose a random* hash function, ha,b from H10007,10. Include your random choice of ha,b with your answer to this problem. Before you rehash the numbers with the new hash function, determine the probability that the keys 112 and 2542 collide when hashed with ha,b ? Hash each of the keys 112; 2542; 9992; 5502 with ha,b. How many keys collided? If you had 1000 keys (all keys were positive integers less than 10000) inserted into a hash table of size 2000 using a hash function, ha,b, randomly chosen from H10007,2000 (the family of universal hash functions we defined in class). What is the expected number of collisions you would have if you inserted a new key, x, into the hash table? *Use a random number generator

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