Consider a double hashing scheme in which the primary hash function is…

2020

Consider a double hashing scheme in which the primary hash function is \(h_1(k) = k\ mod \ 23\) mod 23, and the secondary hash function is \(h_2(k) = 1+(k \ mod \ 19)\). Assume that the table size is 23. Then the address returned by probe 1 in the probe sequence (assume that the probe sequence begins at probe 0) for key value \(k = 90\) is ________ . 

Attempted by 36 students.

Show answer & explanation

Correct answer: 13

Answer: 13

Key formula: probe i = (h1(k) + i * h2(k)) mod 23

  • Compute h1(90) = 90 mod 23 = 21.

  • Compute h2(90) = 1 + (90 mod 19) = 1 + 14 = 15.

  • Probe 1 = (21 + 1 * 15) mod 23 = 36 mod 23 = 13.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir