Question: ) Huffman Code. Suppose we have a text consisting only of a, b, c, d, e, f, g where each character appears with the

) Huffman Code. Suppose we have a text consisting only of a,

  

) Huffman Code. Suppose we have a text consisting only of a, b, c, d, e, f, g where each character appears with the following frequency: a g b d e f 10 3 4 8 14 5 6 Note that the length of the text is 50. (a) (5 points) How many bits do we need to store the text file if using a fixed-length code? (b) (10 points) Show the code built by the Huffman algorithm, both as a tree and as a list (character, codeword). When combining two trees, the tree with lowest root frequency becomes the left child and the tree with the second-lowest root frequency becomes the right child. Left children are associated with the bit 0, right children with the bit 1.See Fig 16.5 (f) in textbook and Lab09 for more details. (c) (5 points) How many bits do we need to store the text file with this Huffman code?

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 Programming Questions!