Data Structures & AlgorithmsHardWipro · Accenture pattern

Keys 22, 33 and 44 are inserted in that order into an empty table of size 11 with h(k) = k mod 11 and quadratic probing hᵢ(k) = (h(k) + i²) mod 11. At which index is 44 placed?

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

Correct answer: B. 4

All three keys hash to 0. 22 → 0; 33 tries 0, then 0 + 1 = 1; 44 tries 0, 1 (both full), then 0 + 4 = 4. Linear probing would have put 44 at 2.

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

Exams that ask this topic