i
cludestdiohi
cludemallochdefi
emaxi
t999structht
ode哈夫曼树结点结构i
tww存放外部结点权值之和i
tpare
tlli
krli
k存放父结点、左结点和右结点typedefstructht
odepht
ode哈夫曼树结点结构指针类型structhttreei
tm外部结点个数i
troot哈夫曼树根在数组的下标pht
odeht存放2m1个结点的数组typedefstructhttreephtree哈夫曼树类型的指针类型哈夫曼树算法函数,构造具有m个外部结点的哈夫曼树phtreehuffma
i
tmi
twphtreephti
tijx1x2m1m2phtphtreemallocsizeofstructhttree分配哈夫曼树空间ifphtNULLpri
tf