Message : BCCABBDDAECCBBAEDDCC
The frequency of Alphabets in the message is :
A = 3, B = 5, C = 6, D = 4, E =2
The Huffman Tree will look like :
So, the Huffman code assigned to each Alphabets are :
A – 011, |A| = 3
B – 10, |B| = 2
C – 11, |C| = 2
D – 00, |D| = 2
E – 010, |E| = 3
Total Number of Bits : 3 x 3 + 5 x 2 + 6 x 2 + 4 x 2 + 2 x 3 = 9 + 10 + 12 + 8 + 6 = 45.