Data Structures & AlgorithmsModerateIBM · Deloitte pattern

1800 keys are stored in a hash table with 600 slots using separate chaining and simple uniform hashing. About how many key comparisons does a successful search make on average?

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

Correct answer: D. 2.5

Load factor α = 1800/600 = 3. A successful search scans about half of the other keys in its chain plus itself: 1 + α/2 = 2.5. An unsuccessful search would scan a whole chain, α = 3.

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

Exams that ask this topic