Computer Science EngineeringHard

A table of size 7 uses h(k) = k mod 7 with linear probing. After inserting 15, 22, 8 and 1 in that order, at which index does key 1 reside?

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

Correct answer: A. 4

All four keys hash to 1, so they occupy indices 1, 2, 3 and 4 in order of insertion.

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic