Prefix code

cosmos 25th August 2017 at 12:03am
Variable-length code

aka prefix-free, or instantaneous code

A string is a prefix of another string if their first nn symbols coincide, for some n1n \geq 1.

A prefix code is a Variable-length code where no codeword is a prefix of another codeword.

(IC 2.5) Prefix codes

(IC 2.6) Prefix codes - remarks and what's next

Any prefix code is uniquely decodable

A prefix code can be represented as a search tree, and is a nice way to think about prefix codes.

The above definition may called left-prefix. There is also the notion of right-prefix. See here

Example to see why prefix codes are faster (in the sense of computational complexity) to decode than other uniquely decodable codes. Prefix codes are decodable in linear time

They satisfy the Kraft inequality