Data Structures & AlgorithmsVery hardGATE CS · TCS NQT

Keys 10, 22, 31, 4, 15, 28, 17, 88, 59 are inserted in this order into an open-addressing table of size 11 with h(k) = k mod 11 and linear probing (probe index +1 mod 11). At which slot (0 to 10) does the key 88 finish?

  1. A. 1
  2. B. 2
  3. C. 0
  4. D. 4

Correct answer: A. 1

Walk the probe sequence from 88 mod 11 = 0, skipping slots already taken by earlier keys. Forgetting that earlier keys occupy the slots changes the answer by one slot.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic