LZW: A lossless file compressor

Among the software I developed in CPSC 323: Systems Programming and Computer Organization, was a rendition of the famous LZW lossless compression algorithm, written in the C language. The original algorithm was published as LZ78 (1978) by Lempel and Ziv; Welch improved upon the algorithm and authored A Technique for High-Performance Data Compressionin which he named it LZW.

LZW is still relevant, as it and its variants are still used today in a variety of contexts, including in the popular GIF format. The LZW is system independent, and became widely popular as the first universal data compression method.

My implementation in the C language was a challenging feat given the limited time-frame (13 days) and rigorous error-proofing required to perfect the code. Apart from implementing the encode and decode algorithms, I had to implement my own data structures in C (a modified hash table, in this case).

My full implementation can be found on Github.

Leave a comment