Huffman coding is a lossless data compression algorithm that assigns variable-length codes to symbols in a message or data stream. It was developed by David A. Huffman in 1952 while he was a student at MIT. The algorithm works by building a binary tree of nodes, where each leaf node represents a symbol in the message and each non-leaf node represents the sum of the frequencies of its children. The tree is built using a priority queue, with the symbols sorted by frequency.
- node.c
- node.h
- stack.c
- stack.h
- Makefile
- pq.c
- pq.h
- code.c
- code.h
- README.md
- define.h
- header.h
- huffman.c
- huffman.h
- io.c
- io.h
- encode.c
- decode.c
- Put all the files in one directory.
- Open the directory in terminal.
- Run command make.
$ make
$ ./encode [-h] [-i infile] [-o outfile]
-h
: Shows help and usage-i infile
: Input containing graph (default: stdin)-o outfile
: Output of computed path (default: stdout)-v
: Enable verbose printing.
$ ./decode [-h] [-i infile] [-o outfile]
-h
: Shows help and usage-i infile
: Input containing graph (default: stdin)-o outfile
: Output of computed path (default: stdout)-v
: Enable verbose printing.
$ make clean
If you are a student and if are taking a look at my repository for your assignment, any piece of code that your copy from this repository is completely your responsibility. I should not be held repsonsible for any academic misconduct.