Question
In a double hashing scheme, and are the auxiliary hash functions. The size of the hash table is . The hash function for the -th probe in the open address table is . The following keys are inserted in the given order: .
The slot at which key gets stored is ___________. (Answer in integer)
Official answer and solution
- Accepted answers
- 10 to 11
- From
- Official GATE 2025 answer key
Solution
Insert the first five keys using , then probe for key using and .
- Insert the first 5 keys ():
- : Slot 8
- : Slot 6
- : Slot 3
- : Slot 2
- : Slot 1
- Insert :
- and .
- Probe : (occupied by ).
- Probe : (occupied by ).
- Probe : (empty!).
Thus key is stored at slot 10 (or 11 if 1-indexed; official key accepts 10 to 11).
10 (10 to 11 accepted)
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2025 Computer Science and Information Technology - Session 1 (CS1)
- Question
- 65 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.