Quote:
|
Originally Posted by Valmont
And once you got something up and working, make sure to tell what is suppose to happen and everything you know. ... The better you communicate, the faster and better I can work.
|
Definitely, will do. Sorry for the spaces in the code I inserted I will try to make sure it is a little more concise. What I am trying to accomplish here is implementing an algorithm for compression and decompression using Lempel-Ziv. I need to read in data from a input file and then write compressed data to an output file. I am supposed to develop separate classes (with appropriate member functions) for compression and decompression but, I would be happy just to get something to work. I should also verify it was correctly implemented by doing a diff and wc of original file, but I still need to read man pages on these commands. The Lempel-Ziv algorithm is something like this:
Code:
STRING = get input character
WHILE there are still input characters DO
CHARACTER = get input character
IF STRING+CHARACTER is in the string table then
STRING = STRING+character
ELSE
output the code for STRING
add STRING+CHARACTER to the string table
STRING = CHARACTER
END of IF
END of WHILE
output the code for STRING
obtained from:
Lempel-Ziv Compression by Mark Nelson
The assignment is suppose to work through a server client program but, for know I think that is a little beyond me. I just want to focus on understanding the code behind this algorithm. Once again thank you very much for your guidance, it is really helping me get a better understanding of what is going on.