Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 generatorStep 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