Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you have enough control over the tree generation, you could make it do a canonical tree (the same way <a href="https://en.wikipedia.org/wiki/DEFLATE" rel="nofollow noreferrer">DEFLATE</a> does, for example), which basically means you create rules to resolve any ambiguous situations when building the tree. Then, like DEFLATE, all you actually have to store are the lengths of the codes for each character.</p> <p>That is, if you had the tree/codes Lasse mentioned above:</p> <ul> <li>A: 00</li> <li>B: 110</li> <li>C: 01</li> <li>D: 111</li> <li>E: 10</li> </ul> <p>Then you could store those as: 2, 3, 2, 3, 2</p> <p>And that's actually enough information to regenerate the huffman table, assuming you're always using the same character set -- say, ASCII. (Which means you couldn't skip letters -- you'd have to list a code length for each one, even if it's zero.)</p> <p>If you also put a limitation on the bit lengths (say, 7 bits), you could store each of these numbers using short binary strings. So 2,3,2,3,2 becomes 010 011 010 011 010 -- Which fits in 2 bytes.</p> <p>If you want to get <em>really</em> crazy, you could do what DEFLATE does, and make another huffman table of the lengths of these codes, and store its code lengths beforehand. Especially since they add extra codes for "insert zero N times in a row" to shorten things further.</p> <p>The RFC for DEFLATE isn't too bad, if you're already familiar with huffman coding: <a href="http://www.ietf.org/rfc/rfc1951.txt" rel="nofollow noreferrer">http://www.ietf.org/rfc/rfc1951.txt</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload