1、问题
2、解析
3、设计
HuffmanTree Huffman(Minheap H)
{
int i;
HuffmanTree T;
for (i = 1; i < H->capacity; i++) {
T = (HuffmanTree)malloc(sizeof(struct TreeNode));
T->Left = &DeleteMin(H);
T->Right = &DeleteMin(H);
T->weight = T->Left->weight + T->Right->weight;
Insert(H, *T);
}
T = &DeleteMin(H);
return T;
4、 分析
5. 源码
- 源码地址:https://github.com/ACynj/huffman.git