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

📄 huffmancode.h

📁 对符号进行huffman编码和解码的程序
💻 H
字号:
// HuffmanCode.h: interface for the Huffman class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_HUFFMANCODE_H__B541F1E0_C006_49BE_8408_E3D94D5891D4__INCLUDED_)
#define AFX_HUFFMANCODE_H__B541F1E0_C006_49BE_8408_E3D94D5891D4__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

struct   elem{   
	char   name;   
	float   weight;   
	int   *code;   
};   

struct   node{   
	node*   leftson;   
	node*   rightson;   
	float   weight;   
	elem   elementary;   
};  

class Huffman  
{
public:
	Huffman();
	virtual ~Huffman();
private:
	int   M;   
	elem   *nodes;   
	node   *tree;   
	int   index;   
	int   *code;   
	int   flag;   
	private://functions   
	void   MakeupTree();   
	void   coding(int,node*);   
	public://functions   
	void   doCode();//coding:编码   
	elem*   deCode(int*);//decode:译码   
};

#endif // !defined(AFX_HUFFMANCODE_H__B541F1E0_C006_49BE_8408_E3D94D5891D4__INCLUDED_)

⌨️ 快捷键说明

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