GATE Computer ScienceHardGATE CS (PYQ pattern)

Which of the following statements about Huffman coding on a set of symbols with positive frequencies is/are correct? I. If f(a) > f(b), then the codeword of a is never longer than the codeword of b. II. The two least frequent symbols can always be given codewords of the same length. III. A symbol with frequency at least 1/3 of the total always receives a 1-bit codeword.

  1. A. I and III only
  2. B. II and III only
  3. C. I, II and III
  4. D. I and II only

Correct answer: D. I and II only

I holds because swapping would lower the cost otherwise; II holds since the two least frequent symbols are siblings at the deepest level. III is false: frequencies 15, 26, 21, 33 (33/95 > 1/3) give every symbol a 2-bit codeword.

More Algorithms questions

Exams that ask this topic