📄 hufnode.cpp
字号:
// HufNode.cpp: implementation of the HufNode class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "HUF3.h"
#include "HufNode.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
HufNode::HufNode()
{
}
HufNode::~HufNode()
{
}
HufNode::HufNode(char c, double p)
{
name=c;
weight=p;
}
void HufNode::initnode()
{
parent=0;
lchild=0;
rchild=0;
weight=0;
name=NULL;
code=NULL;
}
char HufNode::GetName()
{
return name;
}
double HufNode::GetWeight()
{
return weight;
}
void HufNode::PutParent(int p)
{
parent=p;
}
void HufNode::PutLchild(int p)
{
lchild=p;
}
void HufNode::PutRchild(int p)
{
rchild=p;
}
void HufNode::PutWeight(double d)
{
weight=d;
}
int HufNode::GetParent()
{
return parent;
}
void HufNode::PutName(char c)
{
name=c;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -