- 10
- 0
- 约2.31千字
- 约 3页
- 2017-06-08 发布于重庆
- 举报
哈夫曼树构造编码译码源程序
#includestdio.h
#define maxbit 10 /*定义哈夫曼编码最大长度*/
#define maxvalue 10000 /*定义最大权值常量*/
#define maxnodenumber 100 /*定义结点最大数目常量*/
typedef struct /*定义结点结构*/ float weight; char data; int parent,lchild,rchild; htnode;
typedef struct /*定义保存一个叶子结点哈曼编码的结构*/
int bit[maxbit];
int start;
hcodetype;
hcodetype cd[maxbit];
void main /*主函数*/
void huffmancode htnode ht[],int n ; void huffmandecode hcodetype cd[],htnode ht[],int n ;
htnode ht[maxnodenumber];
int i,j,k1,k2,n,a;
float m1,m2;
printf 哈夫曼树的构造及应用\n ;
printf 请输入叶子数目 n: ; /*提示输出叶子结点个数*/
scanf %d,n ;
printf Please input data and weight:\
您可能关注的文档
最近下载
- 中国私董会项目可行性研究报告.docx VIP
- 1.小蜗牛慢慢爬(课件)美术湘美版一年级下册(2026).pptx
- 17ZZ01 市政过水箱涵(未压缩,共2部分,第1部分).pdf VIP
- 高考语文阅读理解《司马迁:生存还是毁灭》含答案.docx VIP
- 《营业厅服务设计》课件.pptx VIP
- 2025年中国公安制证机数据监测研究报告.docx
- 2025年山东省潍坊市中考一模物理试题(含答案).pdf VIP
- 2020~2021学年度第一学期南通市四校联考英语试卷附答案答题纸.pdf VIP
- STC160A(STC6515)塔式起重机说明书(第一册).pdf VIP
- 混凝土结构工程裂缝的判断-板的裂缝.docx VIP
原创力文档

文档评论(0)