# Huffman Encoding

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

In run-length encoding, one breaks up the data into runs of identical elements of varying lengths. Huffman encoding in particular breaks the data—in this case, an array of 1's and 0's—into distinct blocks of three.

[more]
Contributed by: Abigail Nussey (March 2011)

Based on a program by: Oyvind Tafjord

Open content licensed under CC BY-NC-SA

## Snapshots

## Details

Different starting datasets require a different number of codewords in order not to lose any information in the compression. The codewords are designated by numbers on the tabs. The "key" is prepended to the encoded array; the case of the initial example, for instance, shows that and . Dots are placed on the last member of each codeword. In the first example, each codeword is only one member long, but in other examples the codewords are longer.

## Permanent Citation

"Huffman Encoding"

http://demonstrations.wolfram.com/HuffmanEncoding/

Wolfram Demonstrations Project

Published: March 7 2011