⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 defines.h

📁 huffman coding ke yi ce shi jian , you lei
💻 H
字号:

#include <vector>
#include <fstream>
#include <iostream>
#include <string>
#include <utility>
using namespace std;


class hNode
{
public:
	unsigned long weight;
	char value;
	bool used;
	vector<hNode>::iterator pLeft;
	vector<hNode>::iterator pRight;
	vector<hNode>::iterator pFront;

	hNode()
	{
		weight = 0;
		value = 0;
		used = false;
		pLeft = NULL;
		pRight = NULL;
		pFront = NULL;
	}

	void Clear()
	{
		weight = 0;
		value = 0;
		used = false;
		pLeft = NULL;
		pRight = NULL;
		pFront = NULL;
	}
/*	hNode(hNode& node)
	{
		weight = node.weight;
		value = node.value;
		used = node.used;
		pLeft = node.pLeft;
		pRight = node.pRight;
		pFront = node.pFront;
	}
	hNode& operator =(hNode& node)
	{
		weight = node.weight;
		value = node.value;
		used = node.used;
		pLeft = node.pLeft;
		pRight = node.pRight;
		pFront = node.pFront;

		return *this;
	}
*/

};

void GatherData(ifstream& inFile, vector<hNode>& hTree);
void CheckData(vector<hNode>& hTree, string ofile);
void CreatHuffmanTree(vector<hNode>& hTree);
vector<hNode>::iterator FindMinimumNode(vector<hNode>& hTree);

void HuffmanCoding(vector<hNode>& hTree, vector<string>& codeResult);

void CheckData(vector<string>& codeResult, string ofile);


⌨️ 快捷键说明

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