2,589 views
1 votes
1 votes
The following message is:
GATE2018GAATTTEEEE22000011188
What is the average length of bits required for encoding each letter using Huffman coding___?

3 Answers

0 votes
0 votes
Answer is 2.7..

G-1100

A-1101

T-100

E-111

2-010

0-00

1-01

8-011

Avg length =

(4*2 + 4*3 +3*4 +3*5 +3*3 + 2*5 +2 *4 + 2*3)/29= 2.7
0 votes
0 votes
I am following occurences * bits

G = 2*4

A = 3*4

T = 4*3

E = 5*3

2 = 3*3

0 = 5*2

1 = 4*3

8 = 3*3

sum = 87

by adding all occrences = 29

and hence Avg bits = 87/29 = 3.

Related questions

1 votes
1 votes
2 answers
1
Akash Kumar Roy asked Apr 26, 2018
3,932 views
what is Space complexity of Huffman coding?
2 votes
2 votes
1 answer
3
atul_21 asked Nov 13, 2017
682 views
1 votes
1 votes
1 answer
4
Anup patel asked May 21, 2017
803 views
What would be huffman coding for following : CharacterFrequencya10l15i12o3u4s13t1Explain this with suitable diagram..