| View previous topic :: View next topic |
| Author |
Message |
tvsivakumar@gmail.com Guest
|
Posted: Fri Jul 15, 2005 11:08 am Post subject: huffman compression using c++ |
|
|
I have done a project in huffman data compression. But i have few
queries regarding my design. I have a class which contains a map which
is nothing but the code for all the characters which it encounters
while reading a file. But should my reading and writing the decoded
version to be in the member function or should it be in the main? And
if you know any of the sites where there is code in c language and c++
language kindly give me the links to see the source code.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
gmramaswamy@gmail.com Guest
|
Posted: Sat Jul 16, 2005 11:45 pm Post subject: Re: huffman compression using c++ |
|
|
i dont know much about the algorithm here. But i believe these
operations should be in separate class which uses your map class and
has member functions that does encoding and decoding. This will make
the class complete and system object oriented. Moreover main can
written based on interface and not on implemention. So incase you
decide to ship it as library in future it will be easier.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
NJS Guest
|
Posted: Mon Jul 18, 2005 8:17 am Post subject: Re: huffman compression using c++ |
|
|
This isn't directly related to your design question, but the following
article may be of interest to you anyway:
Priority Queues and the STL
http://www.dogma.net/markn/articles/pq_stl/priority.htm
There is a pretty neat example applying priority queues to Huffman
compression near the bottom of the article.
- Niek Sanders
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
|