Computer Sciences > GATE 2026 SET-1 > Hashing
Consider a hash table P[0, 1, …, 10] that is initially empty. The hash table is maintained using open addressing with linear probing. The hash function used is h(x) = (x + 7) mod 11.

Consider the following sequence of insertions performed on P:
1, 13, 22, 15, 11, 24

Which of the following positions in the hash table is/are empty after these insertions are performed?
A
0
B
10
C
2
D
1

Correct : c

Hash function h(x) = (x+7) mod 11. Linear probing on collision. Tracing each insertion:
Insert 1: h(1) = 8 mod 11 = 8. Position 8 is empty → placed at 8.
Insert 13: h(13) = 20 mod 11 = 9. Position 9 is empty → placed at 9.
Insert 22: h(22) = 29 mod 11 = 7. Position 7 is empty → placed at 7.
Insert 15: h(15) = 22 mod 11 = 0. Position 0 is empty → placed at 0.
Insert 11: h(11) = 18 mod 11 = 7. Position 7 is occupied (22). Probe 8 — occupied (1). Probe 9 — occupied (13). Probe 10 — empty → placed at 10.
Insert 24: h(24) = 31 mod 11 = 9. Position 9 is occupied (13). Probe 10 — occupied (11). Probe 0 — occupied (15). Probe 1 — empty → placed at 1.
Final state: positions 0(15), 1(24), 7(22), 8(1), 9(13), 10(11) are occupied. Positions 2, 3, 4, 5, 6 are empty. Among the options, position 2 is empty while positions 0, 1 and 10 are all occupied.
Correct answer: C — Position 2 is empty.

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

hash table linear probing GATE 2026 GATE CS 2026 Set-1 Q37 h(x)=(x+7)mod11 linear probing empty positions open addressing hash table GATE empty positions hash table after insertion GATE hashing GATE 2026 linear probing collision resolution GATE

Unique Visitor Count

Total Unique Visitors

Loading......