Abstract
Huffman coding is a encoding of variable length and a special transformation
form of the binary tree. Its principle is: the code that be used more often will be
changed into the code of shorter lengths, while the codes that be used less often can
be transformed into the code of longer lengths and the unique solution of coding will
be kept. According to the theory of Huffman coding, firstly we enter the character set
which will be used to coding and their weights. Secondly, according to the
fundanmental principle that the sum of the weights needs to be the smallest , the
program designs Huffman tree in accordance with these class which are initialized in
the outline such as class Node,class SuanFa,and class JieMian. At last, the computer
will output Huffman coding on user interface.
And then, we use the Huffman coding tree to decoding after the completion of
Huffman coding tree.Here are difference with encoding process. We will compare the
binary string that the user input with the character set one by one during the processs
of decoding .And then, the cycle of the next character encoding will continue which is
based on the completion of translation of a character. It will be finished until all the
binary code is translated.
During the process of coding and decoding, we encounter many problems, such
as the problem on arithmetic and grammar. However, we try our best to solve these
problems through constant analysis and debugging.Eventually, we achieve the goal
that establish a complete system on coding and decoding successfully.
Key Words:Huffman coding tree;optimal binary tree;coding;decoding
评论0
最新资源