HW2, problem 2.

EECS 207A. UCI. Fall 2004

By Nasser Abbasi

 

Step 1. 1

Step 2. 1

Step 3. 3

Conclusion. 3

 

Step 1

 

First generate the frequency table.

Then use this table to generate the Binary tree. This is the result of these 2 steps:

 

 

 

Step 2

Next Generate the Huffman coding for the above tree. This is the result:

 


 

Step 3

 

Next, use the tree to generate the Huffman code and calculate the compression ratio.

This is the final result:

 

 

Conclusion

For the given input, Huffman encoding resulted in 49% saving in data bandwidth.