Skip to content
GATEiit

GATE CSE 2025 Session 1 Q65: Slot of key 24 under double hashing

Question

In a double hashing scheme, h1(k)=k mod 11h_1(k) = k \bmod 11 and h2(k)=1+(k mod 7)h_2(k) = 1 + (k \bmod 7) are the auxiliary hash functions. The size mm of the hash table is 11. The hash function for the ii-th probe in the open address table is [h1(k)+i h2(k)] mod m[h_1(k) + i\, h_2(k)] \bmod m. The following keys are inserted in the given order: 63, 50, 25, 79, 67, 24.

The slot at which key 24 gets stored is ___________. (Answer in integer)

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 10 to 11 (official GATE 2025 final answer key)

Concept used: Open addressing with double hashing: probe h1(k),h1(k)+h2(k),h1(k)+2h2(k),…h_1(k), h_1(k) + h_2(k), h_1(k) + 2h_2(k), \ldots modulo mm.

First step: Place the earlier keys: 63 → 8, 50 → 6, 25 → 3, 79 → 2, 67 → 1; then 24 starts at 24 mod 11=224 \bmod 11 = 2 with step h2(24)=4h_2(24) = 4.

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 2025 Session 1 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key