Computer Sciences > GATE 2025 SET-1 > Hashing
In a double hashing scheme, h1(k)=k mod 11 and h2(k)=1+(k mod 7) are the auxiliary hash functions. The size m of the hash table is 11. The hash function for the i-th probe in the open address table is [h1(k)+i h2(k)] mod 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)

Correct : Slot 10

The correct answer is Slot 10.
Given: h1(k) = k mod 11, h2(k) = 1 + (k mod 7), table size m = 11.
Probe formula: (h1(k) + i × h2(k)) mod 11
First, insert all preceding keys to know which slots are occupied:
63: 63 mod 11 = 8 → Slot 8
50: 50 mod 11 = 6 → Slot 6
25: 25 mod 11 = 3 → Slot 3
79: 79 mod 11 = 2 → Slot 2
67: 67 mod 11 = 1 → Slot 1
Occupied slots before inserting 24: {1, 2, 3, 6, 8}
Now insert key 24:
h1(24) = 24 mod 11 = 2 → Slot 2 occupied (79)
h2(24) = 1 + (24 mod 7) = 1 + 3 = 4
Probe i=1: (2 + 1×4) mod 11 = 6 → occupied (50)
Probe i=2: (2 + 2×4) mod 11 = 10 mod 11 = 10 → empty ✓
Key 24 is stored at Slot 10.

Similar Questions

Consider a double hashing scheme in which the primary hash function is h1(k) = k mod 23, and the secondary hash function is h2(k) = 1+(k mod 19). Assume that th...
#647 Fill in the Blanks
Which one of the following hash functions on integers will distribute keys most uniformly over 10 buckets numbered 0 to 9 for i ranging from 0 to 2020?
#1173 MCQ
Consider a hash table with 9 slots. The hash function is h(k) = k mod 9. The collisions are resolved by chaining. The following 9 keys are inserted in the order...
#1211 MCQ

Related Topics

double hashing GATE 2025 GATE CS 2025 Set-1 Q65 open addressing hashing h1 k mod 11 h2 k mod 7 probe sequence double hashing hash table size 11 collision resolution GATE key 24 slot 3 hashing data structures GATE 2025 double hashing fill in blank

Unique Visitor Count

Total Unique Visitors

Loading......