Compression algorithm

  • Thread starter Thread starter Z.K.
  • Start date Start date
Z

Z.K.

I not really sure this is the right newsgroup so please excuse me if it
is not.

I am trying to create a simple compression algorithm using the LZW
system and I can find a lot of information on the general description of
it, but how exactly does the dictionary that is used work. Is it just
stored in an array or do you need to write it to a file so that it can
be used the next time you need to decompress a file. I would think it
would need to be stored in a file and then read into an array since if
you compressed the file and then shut down the program, would you not
lose everything in the dictionary and then not be able to decompress the
file? Any help would be appreciated.

Thanks,

Z.K.
 
Z.K. said:
I am trying to create a simple compression algorithm using
the LZW system and I can find a lot of information on the
general description of it, but how exactly does the dictionary
that is used work. [...] I would think it would need to be
stored in a file and then read into an array since if you
compressed the file and then shut down the program, would
you not lose everything in the dictionary and then not be able
to decompress the file?

No, the decompression algorithm reconstructs the dictionary from the
compressed data.

Eq.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top