实现构造哈夫曼树的哈夫曼算法。
该算法使用固定奇偶码,省去了传统算法动态生成哈夫曼树的繁琐过程;
The algorithm uses a fixed set of complementary parity codes to replace the encoding table that dynamically generated by the traditional Huffman method.
而且每棵哈夫曼树都必须有以下结构:编码,信息,频度,双亲,左孩子,右孩子。
Secondly every Huffman tree must have following structure code, data, weight, parent, l-child and r-child but only code and data are needed in decoding .
该方法通过先序遍历哈夫曼树,记录遍历过程,得到存储哈夫曼码表的一种数据结构。
The method gets a data structure for storing static Huffman coding by preordering traverse Huffman binary tree and recording the course of traverse.
根据建立好的哈夫曼树我们进行编码,从根结点出发在左子树则标为0,右则标为1。
According to our well-established Huffman coding, starting from the root node in the left subtree is marked as 0, the right is labeled 1.
哈夫曼编码是哈夫曼树的一个应用。哈夫曼编码应用广泛,如JPEG中就应用了哈夫曼编码。
Huffman coding is widely used, such as JPEG in the application of the Huffman coding.
我们利用哈夫曼算法建立一棵哈夫曼树(最优二叉树),同时将数据出现的频率作为权值赋给哈夫曼树中的结点。
Huffman algorithm we use to establish a Huffman tree (the optimal binary tree), while the frequency of the data as the weights assigned to Huffman tree nodes.
一般情况下,哈夫曼编码所采用的存储结构及构树方法,不仅影响编码效率,而且也没充分利用存储空间。
Generally, the storage of Huffman coding and the way of creating Huffman tree, which not only influence the coding efficiency, but also do not fully make use of the storage space.
求解出所构造的哈夫曼使用树的带权路径长度。
Solving the structure of the Huffman tree with the right to use the path length.
该算法在使二叉树达到最优的运算过程中,完全区别于以往的哈夫曼算法。
This algorithm is totally different from previous huffman algorithm in the operation process of optimizing binary tree.
本文用图论中的最优树构成法证明哈夫曼编码方法是最小冗余的最优码。
In this paper it has been proved by the optimal tree construction of graph theory that Huffman's code is an optimal method of coding with minimum redundancy.
本文用图论中的最优树构成法证明哈夫曼编码方法是最小冗余的最优码。
In this paper it has been proved by the optimal tree construction of graph theory that Huffman's code is an optimal method of coding with minimum redundancy.
应用推荐