标签:malloc 哈夫曼 treenode i++ class str ++ 编码 for
#include <stdio.h> #include <stdlib.h> struct TreeNode{ int Weight; HuffmanTree Left, Right; }; HuffmanTree Huffman(MinHeap H) { int i; HuffmanTree T; for( i = 1; i < H->ESize; i++){ T = 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; }
标签:malloc 哈夫曼 treenode i++ class str ++ 编码 for
原文地址:https://www.cnblogs.com/biankun/p/9119655.html