t=temproot->rlink;if(temproot->c!=-1){ans[anslen++]=temproot->c;temproot=root;}if(temproot->llink==NULL&&temproot->rlink==NULL){printf("你输入的数据不存在于该哈弗曼树中!\n");return;}}printf("输入数据的译码为:\n");for(i=0;i<anslen;i++){printf("%d",ans[i]);}printf("\n");}voidprint(){inti,j;for(i=0;i<n;i++){printf("%.2f:",num[i]->w);for(j=0;j<num[i]->codelen;j++) printf("%c",num[i]->code[j]);printf("\n");}}intmain(){freopen("in.txt","r",stdin);?freopen("out.txt","w",stdout);?node*root=NULL;?root=newnode();SetTree(root);charcode[maxn*maxn];EnCode(root,0,code);print();?printf("按上面的编码规则输入代码:\n");?scanf("%s",code);?DeCode(root,code);return0;}五、测试输入80.60.20.050.050.030.030.030.01输出0.6:00.2:100.05:11000.05:11110.03:110100.03:110110.03:111010.01:11100六、实验报告要求阐述实验目的和实验内容;提交实验程序的功能模块;记录最终测试数据和测试结果。七、心得在实验中我掌握哈夫曼编码的二叉树结构表示方法。