Skip to content
GATEiit

GATE CSE 2020 Q33: Probe 1 address under double hashing for key 90

Question

Consider a double hashing scheme in which the primary hash function is h1(k)=k mod 23h_1(k) = k \bmod 23, and the secondary hash function is h2(k)=1+(k mod 19)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=90k = 90 is _______.

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 13 (official GATE 2020 final answer key)

Concept used: Double hashing: probe ii goes to (h1(k)+i⋅h2(k)) mod m(h_1(k) + i \cdot h_2(k)) \bmod m.

First step: h1(90)=90 mod 23=21h_1(90) = 90 \bmod 23 = 21 and h2(90)=1+(90 mod 19)=15h_2(90) = 1 + (90 \bmod 19) = 15; compute (21+15) mod 23(21 + 15) \bmod 23.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2020 CS question paper and final answer key, organised by IIT Delhi. Question paper · Answer key