It is {$00$,$10$,$01$,$110$} a Huffman code?

118 Views Asked by At

It is {$00$,$10$,$01$,$110$} a Huffman code?( I think that the answer is no, because the corresponding binary tree has only one vertex on the last level)

2

There are 2 best solutions below

0
On BEST ANSWER

You are right. The essence of the construction of a Huffman code is to two pick the two lowest probabilities and place them as siblings (same codelength) in the tree, and so on recursively. Hence, that coodbook cannot be a Huffman code.

0
On

If you want to code 4 letters with binary words, whatever the frequencies of the four letters are, the code $\{00, 10, 01, 11\}$ will be better than $\{00, 10, 01, 110\}$. Thus $\{00, 10, 01, 110\}$ is not a Huffman code.