#ifndef huffman_h_
#define huffman_h_

#include <iostream>
//using namespace std;

class tree
{
public:
	tree* left;
	tree* right;
	unsigned char data;
	long weight;
        
	tree():left(0),right(0),weight(0){};
	tree(const unsigned char D,long w):left(0),right(0),weight(w),data(D){}
	tree(tree *lt,tree *rt):left(lt),right(rt),weight(
				lt->weight+rt->weight){}
};
class comp_tree
{
public:
	bool operator()(const tree* x,const tree* y)const
	{
		return (x->weight>y->weight);
	}
};

#endif

