ProgrammingModerate

A hash table with 10 buckets receives 11 keys. What is the minimum number of collisions guaranteed?

  1. A. At least one bucket holds two keys, by the pigeonhole principle
  2. B. No collision is guaranteed, since the keys could all be different
  3. C. At least 11 collisions
  4. D. Exactly 10 collisions

Correct answer: A. At least one bucket holds two keys, by the pigeonhole principle

Eleven keys in ten buckets force some bucket to hold two or more keys, so at least one collision must occur.

More C Programming questions

Exams that ask this topic