Data Structures & AlgorithmsVery hardTCS Digital · Infosys SP

Keys 112, 95, 54, 144, 21, 31, 32 are inserted in this order into an empty table of size 11 by double hashing: h1(k) = k mod 11, h2(k) = 7 − (k mod 7), probe i at (h1(k) + i·h2(k)) mod 11. In which slot is 32 placed?

  1. A. 5
  2. B. 10
  3. C. 3
  4. D. 2

Correct answer: A. 5

h1(32) = 10 and h2(32) = 3; stepping by 3 from the home slot, the first free slot is 5 after 3 probe(s).

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

Exams that ask this topic