This project implements Huffman coding, a widely used lossless data compression algorithm. It consists of two separate programs:
- Compressor: Compresses a given input file into a smaller representation.
- Decompressor: Recovers the original file from the compressed data.
The project is implemented in C and uses modular design principles, splitting functionality into reusable components such as min-heap utilities, Huffman tree construction, and file operations.
include/: Header files (.h) declaring functions and data structures.src/: Source files (.c) implementing the logic.test_data/: Sample files for testing compression and decompression.
Use the following commands in your terminal (inside the project root folder): gcc src/compressor.c src/minheap.c src/huffman_tree.c src/file_ops.c -Iinclude -o compressor gcc src/decompressor.c src/minheap.c src/huffman_tree.c src/file_ops.c -Iinclude -o decompressor
./compressor <input_file> <output_compressed_file>
./decompressor <input_compressed_file> <output_decompressed_file>
- Efficient Huffman coding using min-heap-based tree construction.
- Modular codebase for ease of maintenance and enhancement.
- Separate tools for compression and decompression.
Developed as a part of an educational project on data compression.