The structure shown above is called a digital search tree and is part of the trie family. It is different from the standard trie because the internal nodes do not live only in the leaves. The following applet will compress and decompress text using LZ78. To crunch text, just type it into the upper window and it should appear in the lower window. If your machine refuses to do so automatically, you can click on Update to force it to crunch the text.
Uncrunching text is similar, just click on the uncrunch box and type tokens into the lower window.
The Binary button converts text into a compressed form. Do note that the vertical bars wouldn't appear normally, but are just there to improve legibility. Detailed comments are also available. For the source, click here. Compression LZW compression, decompression, implementation issues, and algorithms by Prof. Gary Perlman, of Ohio State University.