Data Structures and Algorithms - Old Questions
Question Answer Details
10. A file contains 100 symbols in which following character with their probability of occurrence. Build a Huff man tree according to Greedy Strategy.
Answer
AI Generated Answer
AI is thinking...
Official Answer
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