Project ยท C++ & Algorithms
File Compression Tool
A command-line utility that compresses and decompresses files using Huffman coding to reduce file size while preserving data.
Technologies used
C++
STL
Priority Queue
Trees / Huffman Coding
Bit Manipulation
Command-line Interface
What it does
- Reads any input file and builds a frequency table of bytes.
- Constructs a Huffman tree to generate optimal prefix codes.
- Encodes the file into a compressed binary format (e.g.
.huff). - Decodes the compressed file back to the original file without loss.
Why I built it
I wanted to go deeper into low-level implementation details, data structures, and how compression actually works under the hood. This project was a good way to practice trees, heaps, bit-level operations, and designing a clean command-line interface that real users could run.
Example usage
Example commands:
main.exe -c input.txt output.huffโ compress a filemain.exe -d output.huff restored.txtโ decompress it