Question: Exercise Huffman compression ( 1 5 points ) You are given a text file with the text below, which is made up of the characters

Exercise Huffman compression (15 points)
You are given a text file with the text below, which is made up of the characters I through P.
IIKJIKLKIKKJKILNIPIKKIIOPIJKMPJLJLLKKKKIIMKKJJLJJPIOPKIINMI
MLPKNJLIJKLPOIMLJLPILIKLPKIKJPIOLPNIKPKKKLKPKKKPPKIIIKJLJII
LLKJJIKNPMLPMIOPPKKJIPJIJNIKLNOOONIPKLMKIJPNOMPPLIKLIILLKLK
IKKNLMIIKKIKJIIKKNLONKIMPKKIPKKJLOPPIJKKKKIJPLLJLLIIPJJKKNN
KMIKKNPJJKIKKMKKINILKNNKKJLLILNOKJPNNJKLJLLPMNLOLMPLLIKNIOI
MNNIILMKKKKIIMNIKJILNKLMLKLJLLPMNLOLMPLLIKNIOIMNNIILMKKKKII
MNIKJILNKLML
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 one's 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 ratio? Recall that this is the number of bits in the Huffman encoding
divided by the number of bits in the fixed-length encoding.
 Exercise Huffman compression (15 points) You are given a text file

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!