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

📄 huffnode.cpp

📁 哈夫曼编码解码演示程序
💻 CPP
字号:
// HuffNode.cpp: implementation of the CHuffNode class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Huffman.h"
#include "HuffNode.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CHuffNode::CHuffNode()
{
	weight=-1;
	parent=-1;
	lChild=-1;
	rChild=-1;
	x=y=0;
	bFocus=FALSE;
	bUse=FALSE;
	bIsTrace=FALSE;
}
CHuffNode::CHuffNode(unsigned int w,unsigned int p,unsigned int l,
	unsigned int r)
{
	weight=w;
	parent=p;
	lChild=l;
	rChild=r;
	x=y=0;
	bFocus=FALSE;
	bUse=FALSE;
	bIsTrace=FALSE;
}
CHuffNode::CHuffNode(CHuffNode&ht)
{
	weight=ht.weight;
	parent=ht.parent;
	lChild=ht.lChild;
	rChild=ht.rChild;
	x=ht.x;
	y=ht.y;
	bFocus=ht.bFocus;
	bUse=ht.bUse;
	bIsTrace=ht.bIsTrace;
}
CHuffNode::~CHuffNode()
{

}
void CHuffNode::Set(int w,int p,int l,int r)
{
	weight=w;
	parent=p;
	lChild=l;
	rChild=r;
}
void CHuffNode::SetPos(int xpos,int ypos)
{
	x=xpos;
	y=ypos;
}

⌨️ 快捷键说明

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