CPSC 430 Spring 2003
Program 2
Due Monday, March 24

Implement the Lempel-Ziv text compression algorithm that we discussed in class. You will need to write two separate programs: one for compression and one for decompression. The compression program should take at the command line the name of the file to be compressed and should write a compressed file of the same name with a .lz extension. The decompression program should take the name of the file to be decompressed; it should verify that it has a .lz extension, then write an uncompressed file of the same name without the extension. Use the structure that we discussed in class for your triple: Use a brute force search to find the longest matching substring.

When your program works, compare it to the compress and gzip programs on riddler. Look at how much compression is achieved and how long the compression process takes for files of widely varying sizes. Present and interpret your results.