Data Structures & AlgorithmsVery hardGATE CS · Product placement

Keys 93, 31, 142, 74, 55, 139, 99 are inserted in this order into an empty table of size 11 by double hashing: h1(k) = k mod 11, h2(k) = 5 − (k mod 5), probe i at (h1(k) + i·h2(k)) mod 11. In which slot is 99 placed?

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

Correct answer: B. 1

h1(99) = 0 and h2(99) = 1; stepping by 1 from the home slot, the first free slot is 1 after 2 probe(s).

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

Exams that ask this topic