In this project which includes multiple source files, Huffman compression and decompression algorithms will be implemented. You will refer to the problem 42 on page 858 and the files in the text (e.g. for bit vector, heap, file operations, etc.)
1. Data generation: first print a message like "Please input
factor: " and let user type an integer as a factor number.
Then prompt "Please input user chars:" and user will type a string (up
to 20 characters of a through f).
The input file named "huf.dat" will contain total (factor*freq) for
each character of a-f, and the user chars appear first in the file.
Freq is given on page 858.
For example,
if factor = 10 and user chars are "bbbbb", then there are total 170
a's, 80 b's and so on including user chars in the file
(that is, you need only need 75 more b's to generate for this
example).
2. Compress the file to a binary file "huf.huf". Output on screen the compressed bits of user chars and the Huffman tree in the format given in homework #2.
3. Decompress huf.huf to "huf_new.dat" and output the decompressed user chars.
4. Submission direction:
a. wrap up files on UNIX:
tar cvf USERNAME.tar file1
file2 file3 ...
(one source file which has
main() is USERNAME.cpp)
b. email me the tar file
c. submit a hardcopy of source files