Re: Building Huffman three
- From: "cr88192" <cr88192@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 31 Mar 2007 03:08:18 +1000
"LiloLilo" <danilo.brambilla@xxxxxxxx> wrote in message
news:460d1d06$0$20813$5fc30a8@xxxxxxxxxxxxxxxxxx
Hi all!
suppose I have a small set of data, and I want to compress them using
huffman encoding. Grouping this data by value and counting them, I got the
following counters:
Value 1: 0 (Value 1 present 0 times in data set)
Value 2: 1 (Value 2 present 1 times in data set)
Value 3: 5 ...
Value 4: 11
Value 5: 13
Value 6: 12
Value 7: 5
Value 8: 1
Value 9: 0
My question is: I have to use also Values 1 and 9 that are never present
in data set when building huffman three? It is correct If I suppose that
using them I would get longest words in huffman three, so I'll get a worst
compression?
whether or not to include them is up to the implementor. many typical
implementations will simply omit them from the tree being built.
however, it may make sense to include them as well (for example, if the tree
is not absolute but merely a speculative guess).
in this case, they would get the longest codes, but this doesn't really
matter if they are never (or almost never) actually encoded.
Thank you all!
.
- References:
- Building Huffman three
- From: LiloLilo
- Building Huffman three
- Prev by Date: Building Huffman three
- Next by Date: Re: Don Knuth - Uncompressable sequences
- Previous by thread: Building Huffman three
- Next by thread: Re: Building Huffman three
- Index(es):
Relevant Pages
|
|