GATE Computer ScienceEasyGATE CS (PYQ pattern)

A hash table with chaining has m = 50 slots and stores n = 200 keys; each key is equally likely to be in any slot (simple uniform hashing). What is the expected number of elements examined in a successful search for a key chosen uniformly among the stored keys (counting the sought element itself)?

  1. A. 2.99
  2. B. 3.00
  3. C. 2.00
  4. D. 4.00

Correct answer: A. 2.99

The exact expectation is 1 + α/2 − α/(2n) = 1 + 2 − 0.01 = 2.99, i.e. 1 + (n − 1)/(2m). The commonly quoted 1 + α/2 = 3 drops the small −α/(2n) term.

More Algorithms questions

Exams that ask this topic