The Gateway to Computer Science Excellence
0 votes
501 views
question based on huffman coding for symbol A with probability 0.3 , B with 0.15 ,c with 0.1 ,D with 0.25 ,E with 0.2 (with the convention 0 labeled for left branch and 1 for right) the minimum no of bits required to represent all the symbols together is??

a)1

b)2

c)3

d)4

which bit this question asking??
in Algorithms by (493 points) | 501 views
0
Is it 3?
0
3 bits ?
0
Answer should be 3..
+2
A = 11

B = 101

C = 100

D = 01

E = 00

Hence to represent all symbols at least 3 bits are required.
0
How did you get 11 for A? Solving this one feels like I have to use my third eye.

1 Answer

0 votes

a = "11"

b ="101"

c="100"

d="01"

e="00"

Total bits required to represent huffman code =12.

The average code length is 30*2+15*3+10*3+25*2+20*2 = 225.

by Junior (895 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,309 answers
198,337 comments
105,025 users