Upload Code
loading-left
loading loading loading
loading-right

Loading

Profile
No self-introduction
codes (1)
Huffman coding
no vote
Using Huffman coding for communication can greatly improve the utilization of the channel, shorten the time of information transmission and reduce the transmission cost. According to the principle of Huffman coding, a program is written to calculate Huffman coding on the basis of user input node weights. Input a number of characters and the frequency of each character from the keyboard, take the frequency of characters as the weight of the node, establish a Huffman tree, and calculate the Huffman code of each character. Requirements: 1. Output the initial and final state of the array HT storing the Huffman tree; 2. Output the Huffman code of each character; 3. Input the string composed of the above characters to encode and output the message; (optional) input the Huffman code of the message to decode and output
小兔兔love
2018-07-21
0
1
No more~