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

Keys 64, 41, 52, 49, 80, 69, 89, 86 are inserted into a hash table of size 9 with h(k) = k mod 9 and linear probing. At which index is 80 stored?

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

Correct answer: C. 8

Insert in order, moving to the next slot on collision. Final table: [89, 64, 86, –, 49, 41, 69, 52, 80]; 80 is at index 8.

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

Exams that ask this topic