Huffman Codes:
You are give a text file containing only the characters {a,b,c,d,e,f}. Let F(x) denote the frequency of a character x. Suppose that: F(a) = 13, F(b) = 4, F(c) = 6, F(d) = 17, F(e) = 2, and F(f) = 11.
Give a Huffman code for the above set of frequencies, i.e. specify the binary encoding for each of the six characters.
All the characters are arranged in a descending order based on their frequency of occurence.
Sum of the frequency of all characters = 13 + 4 + 6 + 17 + 2 + 11 = 53
For getting the codeword for a alphabet you just have to follow the arrow lines untill the end and write the digits (0 or 1) obtained in the reverse order.
Get Answers For Free
Most questions answered within 1 hours.