Data Structures & AlgorithmsHardGATE CS · Product placement

Keys 110, 52, 100, 101, 53, 74, 96 are inserted in this order into an empty table of size 13 using quadratic probing: probe i goes to (k mod 13 + i²) mod 13 for i = 0, 1, 2, …. In which slot is 96 placed?

  1. A. 9
  2. B. 8
  3. C. 7
  4. D. 5

Correct answer: B. 8

96 hashes to 5. Offsets 0, 1, 4, 9, … are added to the home slot; the first free slot is 8 (probe i = 4). Linear probing would have placed it in slot 5.

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

Exams that ask this topic