Question: Write a command line program that computes the frequencies of characters in a text file and internally builds a Huffman tree. Print in a console
Write a command line program that computes the frequencies of characters in a text file and internally builds a Huffman tree. Print in a console window the table of characters along with corresponding Huffman codes. The program should then prompt the user to enter a code of 0's and ones. When you press enter the program should decode your input based on the Huffman tree that you constructed from the original input file. If there is an error in the code, print error, rather than the decoded message. Finally, the program should prompt the user for a series of characters. When the user presses enter, those characters should be converted into the corresponding Huffman code based on the Huffman tree built from the original file input.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
