Design and Analysis of Algorithms (COM336) : Huffman Coding
Design and Analysis of Algorithms (COM336) : Huffman Coding
In this project, you will be using a priority queue and a binary tree of your design to
implement a file compression/uncompression algorithm called "Huffman Coding".
Your program will read a text file and compress it using your implementation of the
Huffman coding algorithm found in the explanation. The compressed text will be written
to a file. That compressed file will be then be read back by your program and
uncompressed. The uncompressed text will then be written to a third file. The
uncompressed text file should of course match the original text file.
Summary of Processing
• Read the specified file and count the frequency of all characters in the file.
• Create the Huffman coding tree based on the frequencies.
• Create the table of encodings for each character from the Huffman coding tree.
• Encode the file and output the encoded/compressed file.
• Read the encoded/compressed file you just created, decode it and output the
decoded file.