发布网友 发布时间:2022-06-28 20:13
共1个回答
热心网友 时间:2023-10-10 11:01
我电脑里保存了类似的这样的题目,可以直接运行的:#include#include#include#include#include#include#defineMAXSIZE50//定义huffnode及huffcode,分别用来存储节点信息及各节点编码typedefstruct{chardata;//节点值intweight;//权值intparent;intleft;intright;intflag;}huffnode;typedefstruct{charcode[MAXSIZE];intstart;}huffcode;huffnodehtree[2*MAXSIZE];huffcodehcode[MAXSIZE];//寻找权值最小的节点intselect(inti){intk=32767;intj,q;for(j=0;j<=i;j++){if(htree[j].weight