Question
The keys 5, 28, 19, 15, 26, 33, 12, 17, 10 are inserted into a hash table using the hash function . The collisions are resolved by chaining. After all the keys are inserted, the length of the longest chain is __________. (answer in integer)
Official answer and solution
- Official answer
- 3
- From
- Official GATE 2026 answer key
Solution
Compute for each of the 9 keys and find the maximum bucket count.
Computing for each key:
Bucket counts:
- Bucket : (length )
- Bucket : (length )
- Bucket : (length )
- Bucket : (length )
- Bucket : (length )
The length of the longest chain is .
Final answer
3
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 2 (CS2)
- Question
- 30 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.