Huffman Encoding
Huffman Encoding
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.
The tabs below the encoded array show to which codewords each triplet is assigned, with the "key" to the encoding prepended to the encoded array. You can scroll through the five different examples of starting arrays by changing the value of the "encoding example" controls.
See Details for a more comprehensive explanation of the encoding.