in reply to A Golf question maybe? Huffman with a twist
What output would you want on an input file of:
A valid Huffman output has to look something like:10 a 10 b 11 c 11 d 18 e 19 f
There is simply no way to write a valid Huffman encoding of this example with the letters appearing sorted by weight. (In this representation e appears before c and d.)a 10 000 b 10 001 e 18 01 c 11 100 d 11 101 f 19 11
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re (tilly) 1: A Golf question maybe? Huffman with a twist
by demerphq (Chancellor) on Sep 04, 2001 at 20:51 UTC | |
by tilly (Archbishop) on Sep 04, 2001 at 21:03 UTC | |
by demerphq (Chancellor) on Sep 05, 2001 at 02:52 UTC | |
by tilly (Archbishop) on Sep 05, 2001 at 19:40 UTC |