All mock tests are FREE till 31 December — register to save your progress

Consider double hashing of the form h(k, i) = (h (k) + ih (k)) mod m 1 2 h (k) = k mod m where 1 h (k) = 1 + (k mod n) 2 n = m − 1 m = 701 where and k = 123456 For , what is the difference between first and second probes in terms of slots?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: C. 257

Explanation

h₁ = 123456 mod 701 = 80 and h₂ = 1 + (123456 mod 700) = 257. Successive probes differ by h₂ = 257 slots.

More Data Structures and Algorithms questions