文件名称:huffman
介绍说明--下载内容均来自于网络,请自行研究使用
Huffman编码的关键点是构造一棵Huffman树。其过程是:
1.输入各个叶子节点及其频率,对每个节点的lchild, rchild, parent分别赋初值为0;
2.选择parent为0,且fre最小的两个节点开始建Huffman树,再修改相应节点的lchild, rchild, parent值,如此重复直到Huffman树建立。
3.从叶子到根逆向求每个节点的Huffman编码。
4.解压时,由于Huffman编码是前缀编码,即任一字符的编码都不是另一个字符的编码的前缀,故根据码表我们可以轻松实现解压。-Huffman coding key point is to construct a Huffman tree. The process is:
1 Enter each leaf node and frequency, for each node lchild, rchild, parent were given the initial value is 0
2 Select the parent is 0, and the smallest two nodes fre began to build the Huffman tree, and then modify the corresponding node lchild, rchild, parent values , so repeat until the Huffman tree created.
3 reverse request from the leaf to the root of the Huffman code for each node.
4 decompression, because Huffman coding is a prefix code, that any one character encoding to another character encoding is not the prefix, so according to code table we can easily extract.
1.输入各个叶子节点及其频率,对每个节点的lchild, rchild, parent分别赋初值为0;
2.选择parent为0,且fre最小的两个节点开始建Huffman树,再修改相应节点的lchild, rchild, parent值,如此重复直到Huffman树建立。
3.从叶子到根逆向求每个节点的Huffman编码。
4.解压时,由于Huffman编码是前缀编码,即任一字符的编码都不是另一个字符的编码的前缀,故根据码表我们可以轻松实现解压。-Huffman coding key point is to construct a Huffman tree. The process is:
1 Enter each leaf node and frequency, for each node lchild, rchild, parent were given the initial value is 0
2 Select the parent is 0, and the smallest two nodes fre began to build the Huffman tree, and then modify the corresponding node lchild, rchild, parent values , so repeat until the Huffman tree created.
3 reverse request from the leaf to the root of the Huffman code for each node.
4 decompression, because Huffman coding is a prefix code, that any one character encoding to another character encoding is not the prefix, so according to code table we can easily extract.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
huffman.doc