encodetree.h

来自「使用半适应的huffman算法实现了文件的压缩和解压」· C头文件 代码 · 共 32 行

H
32
字号
#ifndef __ENCODETREE_H__
#define __ENCODETREE_H__

struct treeNode{
	bool operator < (const treeNode& tn)
	{
		return count<tn.count;
	}
	int id;
	unsigned int count;
	unsigned int code_value;
	int left_child;
	int right_child;
};

class encodetree{
private: treeNode tn[512];
		 char path[30];
		 int nodecount;
		 int wordcount;
public: encodetree(const char* filepath);
		~encodetree(){}
		void buildTree(void);
		void showState(void);
		void encoding(treeNode* ttn,unsigned int code,int level);
		int findNode(int nodeid);
		void nodeInfo(int nodeid,unsigned int& code,unsigned int& digit);
		void convetCode(unsigned char* src,int count_s,unsigned char* dest,int& count_d,unsigned char& remain,int& lenth);

};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?