Question: Problem HC ( Huffman compression ) You are given a text file with the text below, which is made up of the characters a through

Problem HC (Huffman compression)
You are given a text file with the text below, which is made up of the characters a through h.
acheahdgfdggeecadafgdeecfcdcachbfabcceegcecbcegchbeeababcbcfdceacaachb
fbdgcadgaegbfbfbbfbfccffhcccahehbffgadhdbfaaeddddceffeaabadfcdffaheecg
dehbggahbeceacedebgfacafdebdchbeehaebfcefaheegbbafdcfdhdfacedhacbeecec
begchhaefdhabcbaacbhachgefcffdgfagdbcahebfcbcaghfgchdchbbfgdfffbhgdbfb
hbcbdfecgfgcfgbhbcffebegafcfhfecfgdddegh
a) How many bits are needed to encode this file given the optimal fixed-length encoding?
b) Compile and write down a list of the counts of each character.
c) Using that list, draw the Huffman encoding tree that would result.
d) Write down a list of the characters and each ones Huffman variable-length encoding.
e) How many bits are needed to encode the file using the Huffman variable-length
encoding?
f) What is the compression ration? Recall that this is the number of bits in the Huffman
encoding divided by the number of bits in the fixed-length encoding.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!