哈夫曼编码与译码(附源码).pdf
《哈夫曼编码与译码(附源码).pdf》由会员分享,可在线阅读,更多相关《哈夫曼编码与译码(附源码).pdf(23页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、建立 Huffman 树进行编码和译码的设计郝萌 1100300423 哈尔滨工业大学计算机科学与技术学院 1003104 班摘要:建立一个简易的系统,对于给定的一篇英文文章,统计字符出现的概率,并根据概率建立Huffman 树,利用 Huffman 编码对文章进行编码和译码。掌握 Huffman 树的建立与应用,并进一步熟练掌握程序的设计流程。关键词:Huffman 树Huffman 编码 文章译码文件压缩解压缩1.引言:给定一篇文章,统计字符出现的概率,根据概率建立哈夫曼树,并进行哈夫曼编码,进而可以利用哈夫曼编码对文章进行编码与译码和文件压缩、解压缩等操作。2.程序设计流程(1)文字表述
2、开始进入功能选择界面,包含五种操作:1.读取文章并对字符编码,2.哈夫曼编码信息,3.文章编码,4.文章译码,5.文件压缩,6.文件解压缩,7.退出程序。操作1:给定一篇文章,统计字符出现的概率,并根据概率建立Huffman 树,并利用Huffman 树对字符进行Huffman 编码。操作 2:显示 Huffman 编码信息,包括字符,字符出现的概率,Huffman 编码。操作 3:对文章进行译码,显示译码信息,并保存。操作4:对文章进行译码,显示并保存。操作5:对文件进行压缩,每 7 位二进制序列对应一个ASCII 码。操作 6:对文件进行解压缩。(2)流程图程序开始程序主界面读取文章并对字
3、符编码哈夫曼编码信息文章编码文章译码退出程序显示文章编码保存文章编码返回上一界面显示文章编码的译码保存文章编码的译码程序结束文件压缩文件解压缩文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7
4、ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I
5、4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7
6、ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I
7、4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7
8、ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I
9、4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8(3)程序数据要求及功能实现主界面1.读取文件并对字符进行编码2.哈夫曼编码信息文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7
10、ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I
11、4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7
12、ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I
13、4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7
14、ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I
15、4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7
16、ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q83.文件编码文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编
17、码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E
18、6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编
19、码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E
20、6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编
21、码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E
22、6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8(1)显示文件编码(2)保存文件编码4.文件译码文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH
23、1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q
24、8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH
25、1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q8文档编码:CX1I4J4U4V7 HH1X7E6A3Z7 ZX3K1I5P8Q
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 哈夫曼 编码 译码 源码
限制150内