登录
首页 » 数据结构 » 假设一个文件中出现了8种符号S0,SQ,S2,S3,S4,S5,S6,S7,那么每种符号要编码,至少需要3bit。假设编码成000,001, 010,011,1...

假设一个文件中出现了8种符号S0,SQ,S2,S3,S4,S5,S6,S7,那么每种符号要编码,至少需要3bit。假设编码成000,001, 010,011,1...

于 2022-04-27 发布 文件大小:227.36 kB
0 142
下载积分: 2 下载次数: 1

代码说明:

假设一个文件中出现了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 smal

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 赫夫曼编码
    数据结构赫夫曼编码-data structure Huffman coding
    2022-03-13 05:28:04下载
    积分:1
  • Very easy to use online testing system, the beta version, if interested, please...
    非常好用的在线考试系统,本版本为测试版,如有兴趣请购买正式版-Very easy to use online testing system, the beta version, if interested, please buy the official version
    2022-06-15 04:33:45下载
    积分:1
  • 高级算法里的排序讲义ppt。sorting
    高级算法里的排序讲义ppt。sorting- In high-level algorithm arrangement printed lecture ppt. Sorting
    2022-02-11 18:40:43下载
    积分:1
  • 库基础知识的笔记题集,对初学者进行复习很有用
    数据库基础知识的笔记题集,对初学者进行复习很有用-database
    2022-09-16 04:35:03下载
    积分:1
  • 在Qt中,使用OCI访问Oracle库的样本
    应用背景在Windows和Linux Qt,我们可以访问 ;使用OCI数据库。用于编译,在窗口中。在项目属性页,库,包括设置,链接。如果Linux,在makefile  ; ;incpath,LIBS设置。例如:…incpath  ; ; ;= -我/选择/ qtsdk-2010.05 / QT / mkspecs / linux-g + + -。。/。/ 6410serverqt -我/选择/ qtsdk-2010.05/qt/include/qtcore -我/选择/ qtsdk-2010.05/qt/include/qtnetwork -我/选择/ qtsdk-2010.05/qt/include/qtgui - I /选择/ qtsdk-2010.05/qt/include - I.。/调试。。/。/ 6410serverqt -我美元(qtdir)/ mkspecs默认-。。/ generatedfiles - igeneratedfiles /调试- igeneratedfiles -我-我/ usr /包括/甲骨文/ 11.2/client…LIBS  ; ; ; ; ;= $(sublibs) ;- L /选择/ qtsdk-2010.05/qt/lib - lqtgui - L /选择/ qtsdk-2010.05/qt/lib - L / usr / X11R6 / lib - lqtnetwork - lqtcore - lpthread  ;- / Oracle 11g/L自民党-低密度脂蛋白- lnsl - lclntsh…关键技术在Windows和Linux Qt,我们可以访问 ;使用OCI数据库。登录的步骤是ocienvcreate, ; ;ocihandlealloc,ocilogon。执行步骤ocistmtprepare, ; ; ;ocistmtexecute,ocitranscommit。如果有参数,ocistmtprepare, ; ; ;ociattrget,ocib
    2022-08-13 11:57:58下载
    积分:1
  • 大整整除,char *d返回余,char*c返回
    大整数整除,char *d返回余数,char*c返回结果 -Large integer divisible, char* d return the remainder, char* c return result
    2022-02-20 02:35:55下载
    积分:1
  • 十字链表和求鞍点的程序
    十字链表和求鞍点的程序-Cross and saddle point for the procedure
    2023-09-03 17:35:04下载
    积分:1
  • ministack类的实现,的作业,模拟出类似stack类的ministack,已经通过测试...
    ministack类的实现,数据结构的作业,模拟出类似stack类的ministack,已经通过测试-ministack class implementation, data structure operations to simulate a similar stack class ministack, has passed the test! !
    2022-05-26 17:08:12下载
    积分:1
  • 一个用vc实现的Kruskal算法,程序流程非常清晰,有助于对算法的理解。...
    一个用vc实现的Kruskal算法,程序流程非常清晰,有助于对算法的理解。-a vc achieved using Kruskal algorithm, program flow is very clear, contribute to the understanding of the algorithm.
    2022-01-29 01:16:47下载
    积分:1
  • 魔王语法解释 的实验和实验报告,包含实验报告,源码等...
    魔王语法解释 数据结构的实验和实验报告,包含实验报告,源码等-Devil syntax explained the experimental data and experimental structure of the report, including test reports, source code, etc.
    2022-06-30 18:28:27下载
    积分:1
  • 696518资源总数
  • 105877会员总数
  • 14今日下载