0001 #define _CRT_SECURE_NO_WARNINGS 0002 0003 #include <iostream> 0004 using namespace std; 0005 0006 #include "_share/util.h" 0007 #include "UniPrint/print.h" 0008 0009 #include "huffman_PQ.h" 0010 0011 extern int* statistics ( char* ); //根据样本文件统计各字符出现频率 0012 extern HuffForest* initForest ( int* ); //创建编码树森林 0013 extern HuffTree* generateTree ( HuffForest* ); //构造编码树 0014 extern HuffTable* generateTable ( HuffTree* ); //由编码树转换为编码表 0015 extern int encode ( HuffTable*, Bitmap*, char* ); //明文的编码,返回编码长度 0016 extern void decode ( HuffTree*, Bitmap*, int ); //二进制串的解码