Jump to content

Prefix code

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 62.119.45.210 (talk) at 06:16, 31 July 2002. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

A prefix code is a code consisting of strings so for any given string in the code, there is no shorter string in the code that is an initial substring of that string.

This means that when strings from the code are put together, you don't need any separators, since it's known when a string ends.

Examples of where prefix codes are used are Huffman coding and Country calling codes.