title: How to decode huffman code quickly?
body: <p>I have implementated <a href="http://code.google.com/p/jcyangs-alg-trunk/source/browse/trunk/bk/APIDSAA/ch5_binary_tree/Huffman/wHuffmanApp.cc" rel="noreferrer">a simple compressor</a> using pure huffman code under Windows.But I do not know much about how to decode the compressed file quickly,my bad algorithm is:</p>
  
  <p>Enumerate all the huffman code in the code table then compare it with the bits in the compressed file.It turns out horrible result:decompressing 3MB file would need 6 hours.</p>
  
  <p>Could you provide a much more efficient algorithm?Should I use Hash or something?</p>
  
  <p><strong>Update</strong>:
  I have implementated <a href="http://code.google.com/p/jcyangs-alg-trunk/source/browse/trunk/bk/APIDSAA/ch5_binary_tree/Huffman/DecodeHuffmanTree.h" rel="noreferrer">the decoder</a> with state table,based on my friend Lin's advice.I think this method should be better than travesal huffman tree,3MB within 6s.</p>
  
  <p>thanks.</p>