Wolfram Research

Function Repository Resource:

HuffmanEncode (1.0.0) current version: 2.0.0 »

Source Notebook

Find a Huffman encoding from a list

Contributed by: Stephen Wolfram

ResourceFunction["HuffmanEncode"][list]

gives an optimal binary Huffman encoding for the data represented by list.

Details and Options

Used in A New Kind of Science, page 1071.

Examples

Basic Examples (1) 

Find the Huffman encoding for a string:

In[1]:=
ResourceFunction["HuffmanEncode", ResourceVersion->"1.0.0"]["compression is based on redundancy"]
Out[1]=
In[2]:=
ResourceFunction["HuffmanDecode"][%]
Out[2]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 2.0.0 – 20 March 2023
  • 1.0.0 – 31 December 2018

Source Metadata

Related Resources

License Information