To complete your submission you will have to write a program that implements 2 methods: •
An encode method that can read in an ASCII text file, count the number of occurrences of each non-whitespace character, convert those frequencies to probabilities, build a Huffman tree consisting of characters and their probabilities, derive Huffman codes, and output a text file containing an encoded version of the original file as well as a text file containing the Huffman codes used in the encoding process. •
A decode method that can read in an encoded ASCII text file and a file containing Huffman codes, and decode the first file according to coding scheme described in the second, outputting a single decoded text file.
Sample Solution