The GATE Grind

GATE 2020 CS – Question 33

Algorithms · Hashing · 1 mark · Numerical answer

Consider a double hashing scheme in which the primary hash function is $h_1(k)=k \bmod 23$, and the secondary hash function is $h_2(k)=1+(k \bmod 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 ______.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 13 to 13

Explanation

Table size $=23$. Key $k=90$.

Probe $i$ goes to $(h_1+i\,h_2)\bmod23$. Probe 1:
$$(21+15)\bmod23=36\bmod23=\mathbf{13}.$$

More Hashing questions

All Hashing questions →