Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
HufNode.cpp
Package: 实验一 Huffman编码源码.zip [view]
Upload User: liruoru
Upload Date: 2007-07-02
Package Size: 43k
Code Size: 1k
Category:
Algorithm
Development Platform:
Visual C++
- // 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;
- }