- C++ programs which can compress and extract the file using Huffman Coding - A lossless data compression using variable length codes. It is the most efficient algorithm for data compression.
- The program encode.cpp needs the name of file as an argument. It will the compress the file using Huffman encoding algorithm and generate a new compressed file with .huf extension.
- The program decode.cpp needs the name of compressed file with extension .huf. Optionally you can also give a second argument specifying the name of the decoded output file.
- The compression ratios depend on the type of the input file.
- For small files(order of bytes) it is not recommended to compress, because of fractional compression ratio. The compressed file occupies more space than input file.
- In general, larger the input file sizes, better is the compression ratios. The compression ratios depend on the probabilities of source's data.
We can see that original file and file generated after decoding are same.