GATE Computer ScienceModerateGATE CS (PYQ pattern)

Under the uniform-hashing assumption, a linear-probing table has load factor 0.5. Using the Knuth approximations, the expected number of probes for an unsuccessful search and for a successful search are respectively:

  1. A. 2 and 1.5
  2. B. 2.5 and 1.25
  3. C. 1.5 and 2.5
  4. D. 2.5 and 1.5

Correct answer: D. 2.5 and 1.5

Unsuccessful: (1/2)(1 + 1/(1 - a)^2) = (1/2)(1 + 4) = 2.5. Successful: (1/2)(1 + 1/(1 - a)) = (1/2)(1 + 2) = 1.5.

More Programming and Data Structures (GATE) questions

Exams that ask this topic