bitree.h

来自「运用面向对象方法编写的一个haffman编码树」· C头文件 代码 · 共 37 行

H
37
字号
// BiTree.h: interface for the CBiTree class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_BITREE_H__2AAB56D0_AE79_43BE_8074_72A835E2219C__INCLUDED_)
#define AFX_BITREE_H__2AAB56D0_AE79_43BE_8074_72A835E2219C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "BiTreeNode.h"
#include <string>
using std::string;
#include <vector>
using std::vector;
class CBiTree  
{
public:
	void Decode(char *p_words,int w_size,char *q_codes,int &code_size);
	void CountLeaves(CBiTreeNode *p);
	void preorder(CBiTreeNode *p);
	void display(CBiTreeNode * temp);
	void editcode(CBiTreeNode *p);//编码
	Calculateweight(int *frelist,float *weight);//计算权值
	CBiTreeNode * CreatTree(float *weight);//建立huffman树
	void printcodes(char *p_codes,int code_size);
	CBiTree();
	virtual ~CBiTree();
public:
	vector <CBiTreeNode *> codes;
	CBiTreeNode *root;
	int depth;

};

#endif // !defined(AFX_BITREE_H__2AAB56D0_AE79_43BE_8074_72A835E2219C__INCLUDED_)

⌨️ 快捷键说明

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