Question: In python 6. 75 points Program C Huffman Coding For this program you will implement Huffman Coding. The program will take a file name as
In python

6. 75 points Program C Huffman Coding For this program you will implement Huffman Coding. The program will take a file name as a command line argument, process it, and produce a prefix-free, variable length binary encoding that minimizes the average codeword lengtlh In addition, your program should output: the encoding, the average codeword length, the total number of bits in the original file (simply the total number of characters multiplied by 8), the total number of bits in the encoded file, and the compression ratio. Your output should resemble something like Character Codeword Frequency 111 17. 7848% 01111011100 0.0502% 1101010 1.0038% 011110110 0.2008% 0111100 0.7194% 1101011100010 0.0167% 1010111000 0.1004% 2 101011101 0.2175% 10101111010 0.0669% 10101111011 0.0669% 10101110010 0.0502% .. . [output truncated for length] Average Codeword Length: 4.386 bits Original Size (bits): 47816 Encoding Size (bits): 26219 Compression Ratio: 54.833% Name your test case files . input001.txt output001.txt input002.txt output002.txt respectively
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
