Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression. The method of compression involves constructing a frequency table of all characters, and based on this, the characters that occur very frequently in the file will have shorter codes, whereas the opposite is true for the less frequent occurring characters.
This is an implementation in C++ which will compress and decompress any text file. Necessary comments are provided to aid the user should he/she peer into the source code.
g++ huffman.cpp main.cpp -o app
./app.exe -c <filepath.txt>
./app.exe -d <filepath.huf>
Given below are the screenshots showing the raw files and their compressed counterparts.


