Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please show all work! A famous hash function when the key values are positive integers is the mid-square method, which squares the key value and
Please show all work!
A famous hash function when the key values are positive integers is the mid-square method, which squares the key value and then takes out the "middle" r digits as the bin number. For instance, when r = 2, and the key value is 3450, we first square 3450 to get 11902500, and then take 02 as the bin number. And if the key value is 3162, we first square 3162 to get 9998244, and then take 98 as the bin number. Now answer the following question assuming that r = 2, and the key values are four digit numbers. (See Lecture 15 notes for guidance) How many buckets(bins) will be needed? For each of the key values 2237, 1697, and 9832, find its corresponding bucket. Give two key values that map to the same bucket(bin). If we need to search for the key value 2015, which bucket(bin) should we search inStep 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