Using Huffman coding, which of the following is the encoding of the string…
2017
Using Huffman coding, which of the following is the encoding of the string aabaabaca?
- A.
110111011001
- B.
110111011111
- C.
110111111001
- D.
110011011011
Attempted by 130 students.
Show answer & explanation
Correct answer: A
Correct answer: 110111011001
The string
aabaabacahas 9 characters with frequenciesa=6, b=2, c=1.Combine the two lowest frequencies:
c(1) + b(2) = 3. Then combine this node witha(6).Using the branch assignment reflected in the options, take
a=1, b=01, c=00.Substitute in order:
a a b a a b a c a -> 1 1 01 1 1 01 1 00 1 = 110111011001.