Skip to content
GATEiit

GATE CSE 2026 Session 2 Q30: Longest chain in a hash table with h(k) = k mod 9

Question

The keys 5, 28, 19, 15, 26, 33, 12, 17, 10 are inserted into a hash table using the hash function h(k)=k mod 9h(k) = k \bmod 9. The collisions are resolved by chaining. After all the keys are inserted, the length of the longest chain is __________. (answer in integer)

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 3 (official GATE 2026 final answer key)

Concept used: With chaining, each slot's chain holds all keys hashing to it.

First step: Compute k mod 9k \bmod 9 for every key and count how many land in each slot.

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

WhatsAppDownload image

Source: official GATE 2026 Session 2 CS question paper and final answer key, organised by IIT Guwahati. Question paper · Answer key