Question
Consider a hash table that is initially empty. The hash table is maintained using open addressing with linear probing. The hash function used is .
Consider the following sequence of insertions performed on :
Which of the following positions in the hash table is/are empty after these insertions are performed?
Official answer and solution
- Official answer
- C
- From
- Official GATE 2026 answer key
Solution
Insert each key sequentially using and linear probing .
Tracing each insertion into :
- : .
- : .
- : .
- : .
- : (occupied) (occupied) (occupied) (empty) .
- : (occupied) (occupied) (occupied) (empty) .
Occupied positions are , and empty positions are . Among the given options, only position 2 is empty.
Option (C)
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2026 Computer Science and Information Technology - Session 1 (CS1)
- Question
- 24 of 65
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.