search
Log In
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users Sep 2019
  1. Satbir

    567 Points

  2. Bikram

    566 Points

  3. GAITONDE

    348 Points

  4. Vimal Patel

    87 Points

  5. Shaik Masthan

    38 Points

  6. BLACK_CLOUD

    14 Points

  7. sekhar_1621

    13 Points

  8. OgbeborBeatrice

    13 Points

  9. RAMYA.F

    9 Points

  10. vkw1111

    9 Points

0 votes
17 views
For the below message number of bits required in Huffman Coding is:

abbaabccdabcd
in Algorithms 144 points 17 views
0
where is frequency ?

2 Answers

0 votes
 
Best answer

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.

BTW here is answer.

  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)$

       

    3. Huffman_tree

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.

199 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. (:
...