文件名称:he_fu_man_bian_ma
- 所属分类:
- 数据结构常用算法
- 资源属性:
- [Windows] [Visual.Net] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 227kb
- 下载次数:
- 0次
- 提 供 者:
- 谭*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
假设一个文件中出现了8种符号S0,SQ,S2,S3,S4,S5,S6,S7,那么每种符号要编码,至少需要3bit。假设编码成000,001, 010,011,100,101,110,111。那么符号序列S0S1S7S0S1S6S2S2S3S4S5S0S0S1编码后变成 000001111000001110010010011100101000000001,共用了42bit。我们发现S0,S1,S2这3个符号出现的频率比较大,其它符号出现的频率比较小,我们采用这样的编码方案:S0到S7的码辽分别01,11,101,0000,0001,0010,0011, 100,那么上述符号序列变成011110001110011101101000000010010010111,共用了39bit。尽管有些码字如 S3,S4,S5,S6变长了(由3位变成4位),但使用频繁的几个码字如S0,S1变短了,所以实现了压缩。对于上述的编码可能导致解码出现非单值性:比如说,如果S0的码字为01,S2的码字为011,那么当序列中出现011时,你不知道是S0的码字后面跟了个1,还是完整的一个S2的码字。因此,编码必须保证较短的编码决不能是较长编码的前缀。符合这种要求的编码称之为前缀编码。要构造符合这样的二进制编码体系,可以通过二叉树来实现。-Suppose a file appears in eight kinds of symbols S0, SQ, S2, S3, S4, S5, S6, S7, then each symbol to be encoded, at least 3bit. Suppose encoding 000,001, 010,011,100,101,110,111. Then the symbolic sequence S0S1S7S0S1S6S2S2S3S4S5S0S0S1 encoded into 000001111000001110010010011100101000000001, sharing a 42bit. We found that S0, S1, S2 these three symbols the frequency of relatively large, the other symbols the frequency is relatively small, we have adopted this coding scheme: S0 to S7 of the yards were 01,11,101,0000,0001,0010 Liao , 0011, 100, then the symbol sequence into 011110001110011101101000000010010010111, shared a 39bit. Although some code words, such as S3, S4, S5, S6 was longer (from 3 into a 4-bit), but a few yards of frequently used words, such as S0, S1 shorter, so to achieve the compression. For the above may lead to decode the presence of non-coding single-valued nature: For example, if the S0 code word for the 01, S2 s code word for the 011, then when the sequence appears
(系统自动生成,下载前可以参看下载内容)
下载文件列表
赫夫曼编码程序设计及报告\报文发送及接收算法设计报告.doc
........................\赫夫曼编码\赫夫曼编码\DataSource.h
........................\..........\..........\DataSource.txt
........................\..........\..........\DSoperator.h
........................\..........\..........\head.h
........................\..........\..........\HTNode.h
........................\..........\..........\HToperator.h
........................\..........\..........\test.c
........................\..........\..........\赫夫曼编码.vcproj
........................\..........\..........\赫夫曼编码.vcproj.A9B2CFAC515D4F1.谭毅.user
........................\..........\赫夫曼编码.ncb
........................\..........\赫夫曼编码.sln
........................\..........\赫夫曼编码.suo
........................\..........\赫夫曼编码
........................\赫夫曼编码
赫夫曼编码程序设计及报告
........................\赫夫曼编码\赫夫曼编码\DataSource.h
........................\..........\..........\DataSource.txt
........................\..........\..........\DSoperator.h
........................\..........\..........\head.h
........................\..........\..........\HTNode.h
........................\..........\..........\HToperator.h
........................\..........\..........\test.c
........................\..........\..........\赫夫曼编码.vcproj
........................\..........\..........\赫夫曼编码.vcproj.A9B2CFAC515D4F1.谭毅.user
........................\..........\赫夫曼编码.ncb
........................\..........\赫夫曼编码.sln
........................\..........\赫夫曼编码.suo
........................\..........\赫夫曼编码
........................\赫夫曼编码
赫夫曼编码程序设计及报告