in Algorithms closed by
459 views
0 votes
0 votes
closed as a duplicate of: huffman coding
We use Huffman's algorithm to obtain an encoding of alphabet {a, b, c} with frequencies fa, fb, fc. Which of the following codes cannot possibly be obtained (no matter what the frequencies are)
Code 1 = {0, 10, 11}
Code 2 = {0, 1, 00}
Code 3 = {10, 01, 00}

(A) Only code 2
(B) Only code 2 and code 3
(C) Only code 1 and code 3
(D) None

answer given -(B)

why code 3 is incorrect??
in Algorithms closed by
459 views

3 Comments

May be because while constructing tree 

at level-2 we have 3 nodes but we should have even number to merge.

0
0
according to this approach what about option (a)??? can you provide some reference.
0
0

This is a valid Huffman code 

0
0