Data Structures & AlgorithmsHardGATE CS · TCS NQT · Product Company SDE

Keys 88, 23, 59, 80, 70, 72, 73, 36 are inserted into a hash table of size 10 with h(k) = k mod 10 and linear probing. At which index is 59 stored?

  1. A. 8
  2. B. 0
  3. C. 14
  4. D. 9

Correct answer: D. 9

Insert in order, moving to the next slot on collision. Final table: [80, 70, 72, 23, 73, –, 36, –, 88, 59]; 59 is at index 9.

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

Exams that ask this topic