This repository supplements my blog post on huffman encoding.
This project is written in C++11. For user comfort, I have also included a makefile that uses g++ as the compiler. Install g++
if you want to do an automatic compilation and running of the program.
- Clone this repository with
git clone https://github.com/aklsh/huffman-coding
- You can also download this repository by clicking on the big green button near the top of this page.
I have included a makefile that will automatically do all the compilation and running of the program. You have to only specify the input file and the output file to the program.
make input="<path of input file>" output="<path of output file>"
The files have to be TEXT FILES ONLY (.txt) .
main.cpp
- contains the main()
for the program.
huffman.h
- contains declaration of all classes and functions.
huffman.cpp
- contains definitions for all functions (including member functions of classes) declared in huffman.h
.
Makefile
- a bash script to automatically compile and run the program.
sample inputs/
- folder containing a few sample input text files.
Please feel free to submit pull requests to this repository!