附:程序代码如下:#include#include#include#include#defineMaxValue10000#defineMaxBit10#defineMaxN100typedefstruct/*哈夫曼树的结点结构*/{doubleweight;/*权值*/intflag;/*标记*/intparent;/*双亲结点下标*/intleftChild;/*左孩子下标*/intrightChild;