Consider the following Huffman trie of a message over the 5-character alphabet {A, B, C, D, E}:
Identify each statement with the best matching description (below tagged with letters A to D).
---- The frequency of A is strictly less than the frequency
of B.
---- The frequency of C is greater than or equal to
the frequency of A.
---- The frequency of D is strictly greater than the
frequency of A.
---- The frequency of D is greater than or equal to
that of A, B, and C combined.
---- The frequency of E is strictly less than that of
A, B, and C combined.
A. True for all messages.
B. False for all messages.
C. Depends on the message.
Answers
C A A C B
i. The frequency of A can be less than the frequency of B or it can be equal to the
frequency of B.
ii. Since A and B are merged first, they have are symbols that have the smallest
frequencies.
iii. Clearly freq(D) >= freq(A). Suppose freq(D) = freq(A). Then, since freq(D) >=
freq(C) >= freq(A), we must have freq(D) = freq(C) = freq(A). In this case, C
and D would be merged (instead of C and {A, B}).
iv. If A, B, and C have frequency 1, then D could have frequency 2 or 3 and produce
the same subtree.
v. If the frequency of E is strictly less than that of A, B, and C combined, then so is
the frequency of D. Hence, D and E would be merged.
Note that if a character appears 0 times, then it will not appear in the Huffman trie