【文件属性】:
文件名称:c++ 源代码 哈夫曼树 哈夫曼编码
文件大小:908KB
文件格式:RAR
更新时间:2014-07-03 09:16:40
c++源代码 哈夫曼树
c++ 源代码 哈夫曼树 哈夫曼编码
部分代码如下:
#include"Huffman.h"
#include"hfmTree.h"
#include
using namespace std;
int main()
{
cout<<"~~~~~~~~~~~~~welcome to Huffman encodrding&decoding system ~~~~~~~~~~~~~~~~~~~~\n\n";
cout<<"You can choose 1--6 options:\n";
cout<<"(1)Initialization \n";
cout<<"(2) Encoding\n";
cout<<"(3) Decording\n";
cout<<"(4) Printing huffman code\n";
cout<<"(5) Printing huffmantree\n";
cout<<"(6) Byebye~!\n\n";
HuffmanTree HT;
int weight;
int choice;
int OK=0;
while ( !OK )
{
cout<<"Please input your option (1--6):";
cin>> choice;
switch( choice)
{
case 1:
cout<<"Please input your code lenth"<>weight;
HT.Initialization(weight);
break;
case 2:
HT.Encoder();
break;
case 3:
HT.Decoder();
break;
case 4:
HT.Print();break;
case 5:
HT.TreePrinting();break;
case 6:
cout<<"\n***********Thanks for Using!***********\n";
OK=1;
break;
return 0;
}
cout<<"(1)Initialization \n";
cout<<"(2) Encoding\n";
cout<<"(3) Decording\n";
cout<<"(4) Printing huffman code\n";
cout<<"(5) Printing huffmantree\n";
cout<<"(6) Byebye~!\n\n";
}
return 0;
}
【文件预览】:
大实验三 哈夫曼树
----大实验三 哈夫曼树.plg(1KB)
----大实验三 哈夫曼树.dsp(4KB)
----大实验三 哈夫曼树.ncb(41KB)
----大实验三 哈夫曼树.dsw(559B)
----hfmTree.h(11KB)
----CodeFile.dat(142B)
----Debug()
--------大实验三 哈夫曼树.pdb(1.09MB)
--------vc60.pdb(116KB)
--------大实验三 哈夫曼树.pch(2.31MB)
--------vc60.idb(89KB)
--------HuffmanTree.obj(399KB)
--------大实验三 哈夫曼树.ilk(808KB)
----Huffman.h(1KB)
----TextFile.dat(26B)
----大实验三 哈夫曼树.opt(48KB)
----TreePrint.dat(1KB)
----HuffmanTree.cpp(1KB)
----CodePrin.dat(142B)
----hfmTree.dat(879B)