Huffman Coding




CS267

Chris Pollett

Apr 14, 2021

Outline

More on Prefix Codes

Making an optimal code tree

Making an optimal code tree

Huffman Coding

Huffman Tree Construction

Example

Huffman tree Example

In-Class Exercise

Suppose the `i`th letter of the English alphabet occurs with probability `i/600` for the letters `a` through `x` and that the letters `y` and `z` occurs with probability `1/4` what would the Huffmann tree look like?

Post your solution to the Apr 14 In-Class Exercise Thread.

Facts About Huffman Codes

Canonical Huffman Codes