UGC NET CS 2018Data Structures and Algorithms › Design TechniquesVerified
UGC NET CS 2018 PYQ: A text is made up of the characters A, B, C, D, E each occurring with the probability 0.08, 0.40, 0.25, 0.15…
A text is made up of the characters A, B, C, D, E each occurring with the probability 0.08, 0.40, 0.25, 0.15 and 0.12 respectively. The optimal coding will have the average length of
- A2.4
- B1.87
- C3.0
- D2.15Correct answer
Answer
(D) 2.15
Approach
Build the Huffman tree from the given probabilities and compute the weighted external path length (average code length).
Reviewed by UGC IQ Editorial Team.