Next:
Up:
Previous:
Prefix Codes
In a
prefix code
, no code is a prefix of another code.
Why?
1.
Any optimal character code has an equally optimal prefix code.
2.
Easy encoding and decoding.
``abc''
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.
Next:
Up:
Previous: