Given a binary code that verifies Kraft's inequality can I state that this code is optimal?
I know that optimal codes verify this inequality, like so $\sum\limits_{i=1}^{M} 2^{-\ell_i} \leq 1$ where $\ell_i$ is the length of a given word. The otherwise is also true?
The condition for an optimal code is it has to be uniquely decodable and instant (doesn't have words as prefixes of another word), right?
For example this binary code $\{0,01,110,111\}$ satisfies this condition but isn't instant. Is it optimal still?
Thanks in advance.