GATE Computer ScienceVery hardGATE CSE · NIELIT

A hash table of size 11 uses h(k) = k mod 11 with quadratic probing: the i-th probe examines slot (h(k) + i²) mod 11, for i = 0, 1, 2, …. The keys 22, 33, 44, 12, 23, 55, 66, 34, 45 are inserted in order. What is the total number of slots examined (probes) over all nine insertions, counting the final empty slot found for each key?

  1. A. 27
  2. B. 34
  3. C. 39
  4. D. 30

Correct answer: D. 30

Tracing each key: probe counts add up to 30 (final table [22,33,12,66,44,23,45,null,null,55,34]).

More Programming and Data Structures (GATE) questions

Exams that ask this topic