Data Compression VI: Compression in Unix II: Lempel-Ziv (compress and uncompress)
Principle: Compression of an arbitrary sequence of bits can be achieved by always coding a series of 0’s and 1’s as some previous such string (the prefix string) plus one new bit. Then the new string formed by adding the new bit to the previously used prefix string becomes a potential prefix string for future strings.
Example: Encode 101011011010101011
Answer: 00010000001000110101011110101101 (see procedure given on slide 12)
If the initial string is short, the encoding may be longer as above, however, for long documents this encoding is close to optimal.