GATE Computer ScienceHardGATE CS (PYQ pattern)

A hash table of size 13 uses double hashing: the probe sequence is (k mod 13 + i·(1 + (k mod 11))) mod 13. Keys 19, 27, 36, 10, 25, 40, 53 are inserted in this order. In which slot does 53 end up?

  1. A. 9
  2. B. 11
  3. C. 8
  4. D. 12

Correct answer: B. 11

Slots: 19 → 6, 27 → 1, 36 → 10, 10 → 10 taken, step 11 → slot 8, 25 → 12, 40 → 1 taken, step 8 → slot 9, 53 → slot 1 taken, step 10 → slot 11 (free). Using the first probe slot only (1) or a unit step would give wrong slots.

More Algorithms questions

Exams that ask this topic