i got another assignenment but i don't understand and couldn't firguge how how to write this program
here is the assignment:
Quote:
Huffman Encoding
Huffman encoding is a text compression technique. It uses bit patterns of different lengths to encode characters. Commonly used letters use short bit patterns and less commonly used letters are coded with longer patterns. Other characters simply use their standard ASCII codes. The table below shows an example of how such codes might be organised.
Huffman Code Character
11 A
0110 E
0111 T
1000 C
1011 L
10010 S
10011 R
101000 O
101001 I
101010 N
101011 H
Under this encoding scheme the word CAT would be stored as 1000110111 and BAT would be stored as 01000010110111.
Write a program that will read a text file specified by the user, and encode it using the Huffman code above. The program should also be able to open files that have been encoded as binary strings and translate them back into characters.
Your program should use an interface similar to the one shown.
Huffman Encoding
==============
0 Exit
1 Encode a text file
2 Decode a compressed file
Which operation would you like to perform? 1
What is the name of the input file?
Sample.text
File not found. Please try again"¦
Sample.text
What is the name of the output file?
Sample.huf
Since there will be no screen output you must submit printed versions of 3 files:
"¢ your program listing
"¢ the output file that your program produces when it encodes sample.txt
"¢ the output file that your program produces when it decodes sample2.huf
anyone help me plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...............