Data Structures & AlgorithmsVery hardGATE CS · Product placement

Keys are inserted into a hash table of size 10 with h(k) = k mod 10 and quadratic probing (h(k) + i²) mod 10. Which statement is correct?

  1. A. Quadratic probing eliminates both primary and secondary clustering
  2. B. Probing from any home slot reaches at most 6 of the 10 slots, so an insertion can fail even when the table has free slots
  3. C. With size 10, a key can be inserted as long as one slot is free
  4. D. Quadratic probing always visits every slot when the table size is even

Correct answer: B. Probing from any home slot reaches at most 6 of the 10 slots, so an insertion can fail even when the table has free slots

i² mod 10 takes only the values 0, 1, 4, 9, 6, 5, so only 6 distinct offsets exist. Quadratic probing removes primary clustering but keys with the same home slot still share a probe sequence (secondary clustering).

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

Exams that ask this topic