Skip to content

ningke/huffman-codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

huffman-codes

A simple implementation of Huffman Codes in C++

The core algorithm is taken from the CLR book (Introduction of Algorithms) Chapter 16.3, and directly used to implement the 'build_tree()' routine.

After the tree is built, a code table that maps a character to a binary code is built from the tree, and used for encoding text. Decoding is done by traversing the Huffman tree, as prescribed by the algorithm.

Binary codes are represented by std::vector, which is a specialized vector that optimizes space.

About

A simple implementation of Huffman Codes in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages