next up previous
Next: Prefix Codes Up: CSE 2320: Algorithms and Previous: Huffman Codes

Prefix Codes

In a prefix code, no code is a prefix of another code.


Any optimal character code has an equally optimal prefix code.
Easy encoding and decoding.
``abc'' $\longrightarrow$ 0.101.100
Once a string of bits matches a character code, output that character with no ambiguity (no need to look ahead).

Use a binary tree for decoding.


Copyright © 1998 The University of Texas at Arlington