Skip to content
Rust implementation of Huffman encoding algorithm
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
Cargo.toml
README.md

README.md

Huffman encoding

Rust implementation of Huffman encoding algorithm inspired by siggraph.org recipe

This proof-of-concept version supports 4 letters: ABCD with fixed probabilities:

Node {symbol: "A", prob: 0.4, left: None, right: None},
Node {symbol: "B", prob: 0.3, left: None, right: None},
Node {symbol: "C", prob: 0.2, left: None, right: None},
Node {symbol: "D", prob: 0.1, left: None, right: None},
[sireliah@sir huffman]$ ./huffman_coding
Type your text to encode.
ACCCCD
Your text: ACCCCD

Result: ["0", "101", "101", "101", "101", "100"]

You can’t perform that action at this time.