Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Find a Huffman encoding from a string
ResourceFunction["HuffmanEncode"]["string"] gives an optimal binary Huffman encoding for a string. |
| "Symbols" | unique symbols in the input string |
| "CodeWords" | binary code words corresponding to each symbol |
| "Encoding" | the Huffman-encoded version of the string |
Find the Huffman encoding for a string:
| In[1]:= |
| Out[1]= | ![]() |
Use the resource function HuffmanDecode to decode the Huffman encoding:
| In[2]:= |
| Out[2]= |
The resource function HuffmanDecode is the inverse of HuffmanEncode:
| In[3]:= |
| Out[3]= | ![]() |
| In[4]:= |
| Out[4]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License