matthew.moss.coder
5/11/2007 4:31:00 PM
> First off, without knowledge of the tree, one can't decode the Huffman
> encoding given in the quiz since the message:
> I want this message to get encoded!
> encodes to the same thing as:
> V jnag guvf zrffntr gb trg rapbqrq!
>
> So, with a Huffman encoding one always needs to know the tree
> structure when doing the decoding. This means that usually what one
> does with Huffman encoding is use some big training database to build
> up your tree, and then one re-uses the same tree again and again.
Another alternative is to do an adaptive Huffman encoding, which does
not require a dictionary at the front of the file, nor a training
database. The dictionary (i.e. tree) is built up during the process of
decoding.
The tradeoff is less compression for small files, or early on in larger files.