Huffman 3 (quiz)

A networking company uses a compression technique to encode the message before transmitting over the network. Suppose the message contains the following characters with their frequency:
{a: 5, b: 9, c: 12, d: 13, e: 16, f: 45}
If the compression technique used is Huffman Coding, how many bits will be saved in the message?
could anyone plz provide solution to this question?

@tishya_goyal
Total number of characters in the message = 100.
Each character takes 1 byte. So total number of bits needed = 800.
After Huffman Coding , the characters can be represented with:
f: 0
c: 100
d: 101
a: 1100
b: 1101
e: 111
Total number of bits needed = 224 Hence, number of bits saved = 800 - 224 = 576

dont forget to hit like and mark the doubt resolved if cleared @tishya_goyal :smiley:

total no. of bits needed=224
how?
plz elaborate

45x1 + 12x3 + 13x3 + 5x4 +9x4 + 16x3 (fcdabe resp) = 224 @tishya_goyal

1 Like

ohh!! i got it…
thank u so much!!

no problem Tishya :smiley:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.