GATE Computer ScienceModerateGATE CS (PYQ pattern)

125 keys are hashed uniformly and independently into 50 chains of a hash table. What are the expected number of keys examined in an unsuccessful search and the expected number of empty chains?

  1. A. 2.5 keys and about 18.4 empty chains
  2. B. 2.5 keys and about 4.0 empty chains
  3. C. 3.5 keys and about 4.0 empty chains
  4. D. 2.5 keys and about 47.5 empty chains

Correct answer: B. 2.5 keys and about 4.0 empty chains

Unsuccessful search scans a whole chain: alpha = 125/50 = 2.5. A chain is empty with probability (1 - 1/50)^125, so expected empty chains = 50 * 0.98^125 = 4.0.

More Programming and Data Structures (GATE) questions

Exams that ask this topic