2020
09-28
09-28
C语言实现哈夫曼编码
本文实例为大家分享了C语言实现哈夫曼编码的具体代码,供大家参考,具体内容如下代码来自于《小甲鱼C++快速入门》主程序main.cpp#include"stdafx.h"#include<stdlib.h>#include"huffman.h"intmain(){htTree*codeTree=buildTree("IlovewwwwwwwwwFishC.com!");//建立哈夫曼树hlTable*codeTable=buildTable(codeTree);//建立编码表encode(codeTable,"IloveFishC.com!");//对输入的字符串进行编码decode(codeTree,"0...
继续阅读 >