文件名称:huffman
- 所属分类:
- 数据结构常用算法
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 127kb
- 下载次数:
- 0次
- 提 供 者:
- hu***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
哈夫曼树的构造,假设有n个权值,则构造出的哈夫曼树有n个叶子结点。 n个权值分别设为 w1、w2、…、wn,则哈夫曼树的构造规则为: (1) 将w1、w2、…,wn看成是有n 棵树的森林(每棵树仅有一个结点); (2) 在森林中选出两个根结点的权值最小的树合并,作为一棵新树的左、右子树,且新树的根结点权值为其左、右子树根结点权值之和; (3)从森林中删除选取的两棵树,并将新树加入森林; (4)重复(2)、(3)步,直到森林中只剩一棵树为止,该树即为所求得的哈夫曼树。-Huffman tree construction, assuming there are n weights, Huffman tree is constructed with n leaf nodes. n-weights are set to w1, w2, ..., wn, the Huffman tree construction rules: (1) w1, w2, ..., wn as a forest of n trees (each tree only There is a node) (2) selected in the forest root weights two smallest trees combined, as a new tree to the left and right sub-tree, and the new root of the tree is the left-right and right sub-tree root and the right value (3) selected from the forest to remove two trees, and adding a new tree forest (4) repeat (2), (3) steps, until only the forest a tree until the tree is obtained by the Huffman tree.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
哈夫曼树\Debug\Huffman.exe
........\.....\Huffman.obj
........\.....\Huffman.pdb
........\.....\vc60.pdb
........\Function.h
........\Huffman.cpp
........\Huffman.dsp
........\Huffman.dsw
........\Huffman.ncb
........\Huffman.opt
........\Huffman.plg
........\Debug
哈夫曼树
........\.....\Huffman.obj
........\.....\Huffman.pdb
........\.....\vc60.pdb
........\Function.h
........\Huffman.cpp
........\Huffman.dsp
........\Huffman.dsw
........\Huffman.ncb
........\Huffman.opt
........\Huffman.plg
........\Debug
哈夫曼树