Talk:Huffman coding: Difference between revisions
Content added Content deleted
(→IS This OK?: Change sort order, larger example) |
|||
Line 172: | Line 172: | ||
u 1 11000 |
u 1 11000 |
||
x 1 11001</pre> |
x 1 11001</pre> |
||
: At a glance it's ok; it's enough that the codes are not ambiguous (a longer code cannot have as "prefix" a shorter one). My code generate apparently a third way... hopefully right: |
|||
<pre> |
|||
(3) 000 |
|||
a (3) 110 |
|||
e (3) 111 |
|||
f (4) 0010 |
|||
h (4) 0011 |
|||
i (4) 0110 |
|||
m (4) 0111 |
|||
n (4) 0100 |
|||
s (4) 0101 |
|||
t (4) 1010 |
|||
l (5) 10010 |
|||
o (5) 10011 |
|||
p (5) 10000 |
|||
r (5) 10001 |
|||
u (5) 10110 |
|||
x (5) 10111 |
|||
</pre> |