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 points
You are given a text file with the text below, which is made up of the characters I through
IIKJIKLKIKKJKILNIPIKKIIOPIJKMPJLJLLKKKKIIMKKJJLJJPIOPKIINMI
MLPKNJLIJKLPOIMLJLPILIKLPKIKJPIOLPNIKPKKKLKPKKKPPKIIIKJLJII
LLKJJIKNPMLPMIOPPKKJIPJIJNIKLNOOONIPKLMKIJPNOMPPLIKLIILLKLK
IKKNLMIIKKIKJIIKKNLONKIMPKKIPKKJLOPPIJKKKKIJPLLJLLIIPJJKKNN
KMIKKNPJJKIKKMKKINILKNNKKJLLILNOKJPNNJKLJLLPMNLOLMPLLIKNIOI
MNNIILMKKKKIIMNIKJILNKLMLKLJLLPMNLOLMPLLIKNIOIMNNIILMKKKKII
MNIKJILNKLML
a How many bits are needed to encode this file given the optimal fixedlength 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 variablelength encoding.
e How many bits are needed to encode the file using the Huffman variablelength 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 fixedlength encoding.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
