diff options
Diffstat (limited to 'lib/Huffman.cc')
-rw-r--r-- | lib/Huffman.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Huffman.cc b/lib/Huffman.cc index aadf927..4f68852 100644 --- a/lib/Huffman.cc +++ b/lib/Huffman.cc @@ -10,7 +10,7 @@ HTree *Coder(PriorityList * P) Datas_t tx, ty; x = y = z = NULL; - + for (i = 0; i < n - 1; i++) { f1 = P->Extract_Min(tx); f2 = P->Extract_Min(ty); @@ -26,6 +26,7 @@ HTree *Coder(PriorityList * P) void HInsert(PriorityList * P, int freq, char *object) { - HTree * leaf = new HTree(freq, object); + HTree *leaf = new HTree(freq, object); + P->Insert(freq, (Datas_t) leaf); } |