Discrete Wavelets with Applications

034 - Huffman Coding

Helmut  Knaust - Department of Mathematical Sciences, University of Texas at El Paso, hknaust@utep.edu
09/14/2010. Last edit: 09/15/2020

SetDirectory[NotebookDirectory[]];
<<DW.m;<<DW1.m;

Huffman coding

a="ABRACADABRA"

Characters[a]

Huffman[Characters["ABRACADABRA"]]

HuffmanTree[Characters["ABRACADABRA"]]

?HuffmanTreeStep

Huffman[Characters["Hollywood"]]

Manipulate[HuffmanTreeStep[Characters["Hollywood"],i,ImageSize->{600,600}],{i,1,8,1}]

list=RandomInteger[{0,10},{10,10}]
Huffman[list]

pic0="Images\\Grayscale\\tower_small.png";
Import[pic0]
pic=Import[pic0,"Data"];
time=TimeUsed[];
Huffman[pic]
Print[Round[TimeUsed[]-time,.1]," sec. of computing time."]