Questions: Huffman Coding: Optimal Prefix Codes via Greedy

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

Symbols A, B, C, D have frequencies 50%, 25%, 15%, and 10% respectively. After Huffman coding, how many bits is A's codeword?

A1 bit
B2 bits
C3 bits
D4 bits — the algorithm distributes bits equally across symbols
Question 2 Multiple Choice

A student applies Huffman coding to a file where all 8 symbols appear with identical frequency. What happens?

AThe algorithm fails — Huffman requires distinct frequencies to determine merge order
BAll symbols receive codewords of equal length (3 bits each), identical to a fixed-length code
COne symbol is arbitrarily assigned a 1-bit code and the rest receive longer codes
DCompression is maximized because identical frequencies are the ideal case
Question 3 True / False

A symbol with frequency greater than 50% will always receive a 1-bit Huffman codeword.

TTrue
FFalse
Question 4 True / False

Huffman coding guarantees optimal compression for any input, even when the actual symbol frequencies in the data differ from those used to build the code tree.

TTrue
FFalse
Question 5 Short Answer

Why must the Huffman tree structure be transmitted alongside the compressed data, and how does this overhead affect the practical use of Huffman coding?

Think about your answer, then reveal below.