GATE 2020 CS – Question 33
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$.
- $h_1(90)=90\bmod23=90-69=21$.
- $h_2(90)=1+(90\bmod19)=1+(90-76)=1+14=15$.
Probe $i$ goes to $(h_1+i\,h_2)\bmod23$. Probe 1:
$$(21+15)\bmod23=36\bmod23=\mathbf{13}.$$