Description: The construction of optimal binary tree; On this basis, the haffman encoder and decoder are completed. Assume that the message only appears as follows:
A B C D E F G H I J K L M N
The frequency is 186, 64, 13, 22, 103, 21, 15, 47, 57, 5, 32, 20, 57
Character O, P, Q, R, S, T, U, V, W, X, Y, Z,.
Frequency 63 15 1 48 51 80 23 8 18 1 16 16 2
The required system should have the following functions:
1. Initialization. Read the data information from the terminal (file) into the character set. Build a haffman tree.
2. Code: use the built Huffman tree to encode the plaintext file and deposit it in the target file (Huffman code file).
3. Decoding: use the built hafman tree to encode the target file (Huffman code file) and store it in the specified plaintext file.
4. Output Huffman code file: haffman code for each character output.
File list (Check if you may need any files):