GATE Computer ScienceModerateGATE CSE

An 11-slot hash table with h(k) = k mod 11 and linear probing receives keys 23, 34, 45, 12, 56, 67, 78 in that order. In which slot (0–10) does 78 end up?

  1. A. 5
  2. B. 6
  3. C. 7
  4. D. 8

Correct answer: C. 7

Every key hashes to slot 1 (all are ≡ 1 mod 11), so they fill slots 1, 2, 3, 4, 5, 6, 7 in order; 78 lands in slot 7.

More Programming and Data Structures (GATE) questions

Exams that ask this topic