Data Structures and Algorithms - Old Questions

10. A file contains 100 symbols in which following character with their probability of occurrence. Build a Huff man tree according to Greedy Strategy.


5 marks | Asked in 2066

Given character and their frequencies:

Now sort these characters according to their frequencies in non-decreasing order.

The Huffman tree constructed for the above data is shown below:







Now from variable length code we get following code sequence.

Thus after using Huffman algorithm the total number of bits required is

= 48*1+11*3+9*4+14*3+7*4+11*3= 220 bits