in Algorithms
1,812 views
1 vote
1 vote
The following message is:
GATE2018GAATTTEEEE22000011188
What is the average length of bits required for encoding each letter using Huffman coding___?
in Algorithms
1.8k views

2 Comments

is it 3.034?
0
0
given 2.71 but i am getting 1.71
0
0

3 Answers

4 votes
4 votes
Best answer

....

selected by

1 comment

Neat๐Ÿ‘Œ
0
0
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

4 Comments

Yes you are right.. I made mistake..
0
0
For this particular question different trees are possible with different Avg values.. Isn't??
0
0
yes its 87/29=3 its coming...
0
0
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.