C Programming MCQ

1: A text is made up of the characters a, b, c, d, e each occurring with the probability 0.12, 0.4, 0.15,0.08 and .25 respectively. The optimal coding tech-nique will have the average length of
A. 2.15
B. 3.78
C. 2.78
D. 1.78
 

Answer : A

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

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.