#include<iostream>
#include<fstream>
using namespace std;
#define MAXSIZE 10000
struct HNode
{
int weight;
int parent;
int lch;
int rch;
};
struct HCode
{
char data;
char code[100];
};
class Huffman
{
private:
HNode * HTree; //哈夫曼树
HCode * HCodeTable; //哈夫曼编码表
int count; //哈夫曼编码表中出现的字符种类数
public:
int WeiArr(char * input,int* &a, char* &b);//生成权值表
void CreateHTree(int a[]); //创建哈夫曼树
void CreateCodeTable(char b[]); //创建编码表
void Encode(char * &s, char * input); //编码
void Decode(char * s, char * &output;); //解码
void CoutHCodeTalbe(); //输出哈夫曼编码表
~Huffman();
};