数据结构第六章实验.docVIP

  • 7
  • 0
  • 约6.11千字
  • 约 11页
  • 2018-01-05 发布于河南
  • 举报
数据结构第六章实验

#includeiostream.h #includestdlib.h #includestring.h typedef struct{ unsigned int weight; unsigned int parent,lchild,rchild; }HTNode,*HuffmanTree; typedef char * *HuffmanCode; /*void Select(HuffmanTree HT,int n,int s1,int s2) { s1=1;int j; for(j=1;j=n;j++) { while(HT[j].parent==0) { if(HT[s1].weightHT[j].weight) s1=j; } } HT[s1].parent=1; if(s1!=1)s2=1;else s2=2; for( j=1;j=n;j++) { while(HT[j].parent==0) { if(HT[s2].weightHT[j].weight) s2=j; } } }错误,未查出原因*/ int min(HuffmanTree t,int i) { int j,flag; unsigned int k; for(j=1;j=i;j++) if(t[j

文档评论(0)

1亿VIP精品文档

相关文档