Is there an efficient algorithm to verify that a finite binary code is uniquely decodeable?

39 Views Asked by At

Is there an efficient algorithm to verify that a finite binary code is uniquely decodeable?

Say we have some finite alphabet of symbols $\mathcal{A}$ and some encoding for each symbol $C$. What is the fastest way to check if $C$ is uniquely decodable: i.e., there are no distinct strings $s_1$ and $s_2$ in $\mathcal{A}^+$ such that $C^+(s_1) = C^+(s_2)$?

1

There are 1 best solutions below

0
On BEST ANSWER

There is, although not trivial: Sardinas–Patterson algorithm (1953).