哈夫曼树构造编码译码源程序.docVIP

  • 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:\

文档评论(0)

1亿VIP精品文档

相关文档