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
Let d 1 and m 5 the most common divisor of the hash function Suppose that slot h1k contains the requ... View full answer
Get step-by-step solutions from verified subject matter experts
