哈夫曼编码 数据结构课程设计.docVIP

  • 14
  • 0
  • 约4.7千字
  • 约 8页
  • 2017-12-22 发布于河南
  • 举报
哈夫曼编码 数据结构课程设计

哈夫曼编码 数据结构课程设计 #include stdio.h #include malloc.h #include conio.h #include string.h #include stdlib.h #define max 200 typedef struct huffmantree { int weight; int parent; int lchild; int rchild; }HT; char a1[max]; int a2[max]; char a[max]; int n; void writefile() { FILE *fp; printf(\n请输入要编码的字符串:\n\n); scanf(%s,a); n=strlen(a); if((fp=fopen(soucefile.txt,w))==NULL) { printf(文件打开失败!); exit(0); } fprintf(fp,%s,a); fclose(fp); printf(\n\n你输入的字符已存入到文件soucefile.txt中!\n); } void select(HT *tree,int n,int *s1,int *s2) { int min1,min2,i=0; min1=

文档评论(0)

1亿VIP精品文档

相关文档