Huffman code with lookup table
<p>I have read an article on Internet and know that the natural way of decoding by traversing from root but I want to do it faster with a lookup table.</p>

<p>After reading, I still cannot get the points.</p>

<p>ex:</p>

<pre>
input:"abcdaabaaabaaa"
code   data
0      a
10     b
110    c
111    d
</pre>

<p>The article says that due to variable length, it determine the length by taking a bit of string of
max code length and use it as index.  </p>

<pre>
output:"010110111001000010000"
Index    Index(binary)    Code    Bits required
0        000              a       1
1        001              a       1
2        010              a       1
3        011              a       1
4        100              b       2
5        101              b       2
6        110              c       3
7        111              d       3
</pre>

<p>My questions are:</p>

<ol>
<li><p>What does it means <code>due to variable length, it determine the length by taking a bit of string of
max code length</code>? How to determine the length?</p></li>
<li><p>How to generate the lookup table and how to use it? What is the algorithm behind?</p></li>
</ol>
