31 views
For the below message number of bits required in Huffman Coding is:

abbaabccdabcd
| 31 views
0
where is frequency ?

Do you have reffered to CLR.

I think if you have studied this algorithm atleast one you would not be asking this question here. I’m not discouraging asking questions.

But I’m suggesting you a way which would be more effective.

1. $(1^{st}pass)$
1. $freq(a) = 4$
2. $freq(b) = 4$
3. $freq( c) = 3$
4. $freq(d) = 2$
2. $(2^{nd} pass)$
1. $freq(\{c,d\}) = 5$
2. $freq(a) = 4$
3. $freq(b) = 4$
3. $(3^{rd} pass)$
1. $freq(\{a,b\}) = 8$     $(assigned \space bit – 0)$
2. $freq(\{c,d\}) = 5$     $(assigned \space bit – 1)$

So, every letter is assigned $2-bit$ code and we have total $13$ letter message so we need total of $26\space bits$ to encode this message.

by (911 points)
selected by
0
Bro, I have already solved the que in less than a minute.

This was just to verify the process.

It doesn’t matter whether to ask or not.

The portal is for asking all types of doubts whether easy, sill or medium whatever.

Anyway there is a much better method than this.
0
Can you please provide better method so I too can take advantage of it. (: