Data Structures

1: A text is made up of the characters a, b, c, d, e each occurring with the probability .12, .4, .15, .08 and .25 respectively. The optimal coding technique will have the average length of  
A.

2.15

B.

3.01

C.

2.3

D.

1.78

 

Answer : A

Explanation :

Using Hoffman's algorithm, code for a is 1111; b is 0; c is 110; d is 1110; e is 10. Average code length is
4 x.12 + 1 x .4 + 3 x.15 + 4 x.08 + 2 x.25 = 2.15

raj said: (3:04am on Wednesday 5th June 2013)
if code for a is 1111 then it must be multiplied by 15 i.e .12x15 refer link http://www.siggraph.org/education/materials/HyperGraph/video/mpeg/mpegfaq/huffman_tutorial.html

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.