Data Structures & AlgorithmsHardTCS Digital · Infosys SP

Keys 81, 25, 26, 79, 49, 55, 59, 93 are inserted in this order into an empty table of size 11 with h(k) = k mod 11 and linear probing. Counting the first slot examined as one probe, how many probes in total do the 8 insertions make?

  1. A. 15
  2. B. 16
  3. C. 8
  4. D. 17

Correct answer: B. 16

Probes per key: 1, 1, 2, 1, 2, 1, 4, 4, total 16. Counting only collisions (probes beyond the first) would give 8.

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

Exams that ask this topic