补。附件:源程序代码#include"stdio.h"#include"stdlib.h"#include"string.h"#defineMAX100structHafNode{intweight;intparent;charch;intlchild;intrchild;}*myHaffTree;structCodingcharbit[MAX];charch;intweight;}*myHaffCode;voidHaffmanfintn)/*构造哈弗曼树*/{intiJxl,x2,sl,s2;for(i=n+l;i<=2*n-l;i++){sl=s2=10000;xl=x2=0;for(j二l;jv二i・l;j++){if(myHaffTree[j].parent==O&&myHaffTree[j].weight<sl){s2=sl;x2=xl;sl=myHaffTree[j].weight;xl=j;}elseif(myHaffTree[j].parent==O&&myHaffTree[j].weightvs2){s2=myHaffTree[j].weight;x2=j;}}myHaffTree[xl].parent=i;myHaffTree[x2].parent=i;myHaffTree[i].weight=sl+s2;myHaffTree[i].lchild=xl;myHaffTree[i].rchild=x2;}}voidHaffmanCodefintn){intstart’cfijk;char*cd;cd=(char*)malbc(n*sizeof(char)J;myHaffCode=(structCoding*)malfoc((n+l)*sizeof(structCoding));cd[n-l]=,\0,;for(i=l;i<=n;++i)start=n-l;