ProgrammingHard

With 10^5 keys and a load factor of at most 0.5, what is the smallest power-of-two table size that works?

  1. A. 262144
  2. B. 131072
  3. C. 524288
  4. D. 200000

Correct answer: A. 262144

The table must hold at least 2 x 10^5 slots. 2^17 = 131072 is too small, and 2^18 = 262144 is the first power of two that is large enough.

More C Programming questions

Exams that ask this topic