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?

  1. A.

    110111011001

  2. B.

    110111011111

  3. C.

    110111111001

  4. D.

    110011011011

Attempted by 130 students.

Show answer & explanation

Correct answer: A

Correct answer: 110111011001

  1. The string aabaabaca has 9 characters with frequencies a=6, b=2, c=1.

  2. Combine the two lowest frequencies: c(1) + b(2) = 3. Then combine this node with a(6).

  3. Using the branch assignment reflected in the options, take a=1, b=01, c=00.

  4. Substitute in order: a a b a a b a c a -> 1 1 01 1 1 01 1 00 1 = 110111011001.

Explore the full course: Coal India Management Trainee