CSCI605 Week 7 Assignment 2 solution


Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment


5/5 - (4 votes)

Your assignment is to implement Huffman encoding (decoding will be next week). Your solution will be called It will accept a command line parameter for the file that you will be encoding. You will go through the process to generate the binary representation for each character present in the input file. You will output two files. One file will contain all of the encoding information in an easy to read format such as csv.

For example, the first output might look like the following if the input file contained “go go gophers”


character,binary code










The second output file will be the encoded file. Note: this file should include a header needed for decoding. It should also be smaller in size than the input file. The size difference should increase based on the size of the input file. Therefore, you should be testing with files that are large enough for your encoding to be apparent such as the provided text file war_and_peace.txt.


There are many tutorials and guides on how to implement this algorithm on the web. You are permitted to use those guides as a resource, but you need to be able to fully explain your solution to your grader. It is very obvious to the grader if you do not understand your submitted code! If you are not able to explain your code, you will not receive any credit for this assignment.


Correctness: You can lose up to 20% if your solution is not correct
Quality: You can lose up to 20% if your solution is poorly designed
Testing: You can lose up to 20% if your solution is not well tested
Explanation: You can lose up to 40% if you cannot explain your solution during the grading session