2c03-review - 00067

2c03-review - 00067 - 0 1 0 1 0.29 0.31 0.2 0.2 0 1 j 0 1 i...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
10 12.[10] Suppose characters a, b, c, d, e, f, g, h, i, j have probabilities 0.02, 0.02, 0.03, , 0.04, 0.05, 0.10, 0.10, 0.13, 0.20, 0.31, respectively. Construct an optimal Huffman code and draw the Huffman tree. Use the following rules: a. Left: 0, right: 1 For identical probabilities, group them from the left to right. What is the average code length? 1.0 0 1 0.6 0.4
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 0 1 0 1 0.29 0.31 0.2 0.2 0 1 j 0 1 i 0.16 0.13 0.1 0.1 0 1 h f g 0.07 0.09 1 1 0.04 0.03 0.04 0.05 0 1 c d e 0.02 0.02 a b a b c d e F g h i j Code 000000 000001 00001 00010 00011 100 101 001 11 01 Length 6 6 5 5 5 3 3 3 2 2 probability 0.02 0.02 0.03 0.04 0.05 0.1 0.1 0.13 0.2 0.31 average 0.12 0.12 0.15 0.2 0.25 0.3 0.3 0.39 0.4 0.31 Total average 2.54...
View Full Document

Ask a homework question - tutors are online