资源描述:
《哈夫曼的编码译码系统的实现》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、哈夫曼的编码译码系统的实现:BTNode.h源代码:#include#include"BTree.h"#include"PrioQueue.h"#includetemplateclassHfmTree:publicBTree{public:operatorT()const{returnweight;}TgetW(){returnweight;}voidputW(constT&x){weight=x;}SetNull(){root=NULL;}private:Tweight;};template2、ssT>HfmTreeCreateHfmTree(Tw[],charch[],intn){PrioQueue>pq(n);HfmTreex,y,z,zero;for(inti=0;i3、pq.Append(z);z.SetNull();}pq.Serve(z);returnz;}voidprint(){charc;cout<<"tttextfile.txt"<