GATE DA 2025 Q18: Hashing with linear probing: h(x) = 3x mod 10
- Programming, Data Structures and Algorithms
- 1 mark
- MCQ
- −1/3 if wrong
Question
Consider a hash table of size 10 with indices , with the hash function
where linear probing is used to handle collisions. The hash table is initially empty and then the following sequence of keys is inserted into the hash table: . The indices where the keys 14 and 15 are stored are, respectively
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: D (official GATE 2025 final answer key)
Concept used: Hash table insertion with linear probing.
First step: Place the first four keys: , , , . Then is already taken, so probe forward.
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
Source: official GATE 2025 DA question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key
More Programming, Data Structures and Algorithms PYQs
- 2025 · Q23Python lists: which call gives A = [1, 2, 3, 4, 5, 6]?
- 2025 · Q27When does binary search run in O(log n)?
- 2025 · Q29Insertion sort with exactly two swaps: possible values of x
- 2025 · Q47Python sets in a while loop: which set ends up with "this"?
- 2025 · Q58Shortest paths: which edges cannot be in G?
- 2025 · Q63Python recursion: value of f(15, 10)