文件名称:05605-19-
- 所属分类:
- 其他小程序
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 11kb
- 下载次数:
- 0次
- 提 供 者:
- 于*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
下载
别用迅雷、360浏览器下载。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
介绍说明--下载内容均来自于网络,请自行研究使用
构造哈夫曼树
哈弗曼树中没有度为一的节点,是标准的二叉树,所以有n个叶子结点时,需要一个长度为2n-1的一维数组存储哈弗曼树的结点。
(1)、n个叶子节点只有weight权值,处理非叶子节点,从ht[i](ht[1]~ht[n-1])中找到ht[i].weight最小的两个节点ht[s1]和ht[s2],这就是Select(int n,int &s1,int & s2,HTNode *ht)函数完成的功能。
(2)、调用select函数,并将ht[s1]和ht[s2]作为ht[l]的左右子树,即ht[s1]和ht[s2]双亲节点为ht[l],新的根节点的权值为其左右子树权值之和, ht[l].weight=ht[s1].weight+ht[s2].weight
-Huffman tree structure tree哈弗曼no degree 1 nodes, is a standard binary tree, there is a leaf node n, the need for a length of 2n-1 one-dimensional array of storage哈弗曼tree nodes. (1), n a leaf node, only the right to weight the value of treatment of non-leaf node, from ht [i] (ht [1] ~ ht [n-1]) found in ht [i]. Weight minimum of two nodes ht [s1] and ht [s2], This is the Select (int n, int
哈弗曼树中没有度为一的节点,是标准的二叉树,所以有n个叶子结点时,需要一个长度为2n-1的一维数组存储哈弗曼树的结点。
(1)、n个叶子节点只有weight权值,处理非叶子节点,从ht[i](ht[1]~ht[n-1])中找到ht[i].weight最小的两个节点ht[s1]和ht[s2],这就是Select(int n,int &s1,int & s2,HTNode *ht)函数完成的功能。
(2)、调用select函数,并将ht[s1]和ht[s2]作为ht[l]的左右子树,即ht[s1]和ht[s2]双亲节点为ht[l],新的根节点的权值为其左右子树权值之和, ht[l].weight=ht[s1].weight+ht[s2].weight
-Huffman tree structure tree哈弗曼no degree 1 nodes, is a standard binary tree, there is a leaf node n, the need for a length of 2n-1 one-dimensional array of storage哈弗曼tree nodes. (1), n a leaf node, only the right to weight the value of treatment of non-leaf node, from ht [i] (ht [1] ~ ht [n-1]) found in ht [i]. Weight minimum of two nodes ht [s1] and ht [s2], This is the Select (int n, int
(系统自动生成,下载前可以参看下载内容)
下载文件列表
05605+19+于洁
.............\huffman.cpp
.............\huffman.dsp
.............\huffman.dsw
.............\huffman.ncb
.............\huffman.opt
.............\huffman.plg
.............\说明.doc
.............\huffman.cpp
.............\huffman.dsp
.............\huffman.dsw
.............\huffman.ncb
.............\huffman.opt
.............\huffman.plg
.............\说明.doc