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

📄 hufnode.cpp

📁 Huffman编码1. 给出信源符号的一阶概率分布
💻 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 + -