Question: Suppose that we use double hashing to resolve collisionsthat is, we use the hash function h(k, i) = (h 1 (k) + ih 2 (k))

Suppose that we use double hashing to resolve collisions—that is, we use the hash function h(k, i) = (h1(k) + ih2(k)) mod m. Show that if m and h2(k) have greatest common divisor d â‰¥ 1 for some key k, then an unsuccessful search for key k examines (1/d)th of the hash table before returning to slot h1(k). Thus, when d = 1, so that m and h2(k) are relatively prime, the search may examine the entire hash table.

Step by Step Solution

3.43 Rating (169 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Let d 1 and m 5 the most common divisor of the hash function Suppose that slot h1k contains the requ... View full answer

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 Introduction to Algorithms Questions!