登录
首页 » Visual C++ » huffman

huffman

于 2010-03-09 发布 文件大小:7KB
0 278
下载积分: 1 下载次数: 119

代码说明:

  哈夫曼编码进行信息通讯可以大大提高信道利用率,缩短信息传输时间,降低传输成本。但是,这要求在发送端通过一个编码系统对待传数据预先编码;在接收端将传来的数据进行译码(复原)。对于双工信道(即可以双向传输信息的信道),每端都需要一个完整的编/译码系统,试为这样的信息收发站写一个哈夫曼编译码系统。 一个完整的系统应具有以下功能: (1) (1) I: 初始化。从终端读入字符集大小 n ,及 n 个字符和 n 个权值,建立哈夫曼树,并将其存于文件hfmtree中。 (2) C: 编码。利用已建好的哈夫曼树(如不在内存,则从文件hfmtree中读入),对文件tobetrans中的正文进行编码,然后将结果存入文件codefile中。 (3) D: 译码。利用已建好的哈夫曼树将文件codefile中的代码进行译码,结果存入文件textfile中。 (4) P: 打印代码文件。将文件codefi1e以紧凑格式显示在终端上,每行50个代码。同时将此字符形式的编码文件写入文件codeprint中。 (5) T:打印哈夫曼树。将已在内存中的哈夫曼树以直观的方式(树或凹凸表形式)显示在屏幕上,同时将此字符形式的哈夫曼树写入文件treeprint中。 (利用哈夫曼编码进行信息通讯可以大大提高信道利用率,缩短信息传输时间,降低传输成本。但是,这要求在发送端通过一个编码系统对待传数据预先编码;在接收端将传来的数据进行译码(复原)。对于双工信道(即可以双向传输信息的信道),每端都需要一个完整的编/译码系统,试为这样的信息收发站写一个哈夫曼编译码系统。 一个完整的系统应具有以下功能: (1) (1) I: 初始化。从终端读入字符集大小 n ,及 n 个字符和 n 个权值,建立哈夫曼树,并将其存于文件hfmtree中。 (2) C: 编码。利用已建好的哈夫曼树(如不在内存,则从文件hfmtree中读入),对文件tobetrans中的正文进行编码,然后将结果存入文件codefile中。 (3) D: 译码。利用已建好的哈夫曼树将文件codefile中的代码进行译码,结果存入文件textfile中。 (4) P: 打印代码文件。将文件codefi1e以紧凑格式显示在终端上,每行50个代码。同时将此字符形式的编码文件写入文件codeprint中。 (5) T:打印哈夫曼树。将已在内存中的哈夫曼树以直观的方式(树或凹凸表形式)显示在屏幕上,同时将此字符形式的哈夫曼树写入文件treeprint中。 )

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

发表评论

0 个回复

  • snow
    vb模拟雪花,想要电脑屏幕上有令人动容的雪花吗,想不到vb也能做到(vb simulated snow, want to have a computer screen you moving snow, can not think can be done vb)
    2009-04-22 11:52:04下载
    积分:1
  • AN1004
    This article covers the so-called "min-cost flow" problem, which has many applications for both TopCoder competitors and professional programmers. The article is targeted to readers who are not familiar with the subject, with a focus more on providing a general understanding of the ideas involved rather than heavy theory or technical details for a more in-depth look at this topic, check out the references at the end of this article, in particular [1].
    2009-11-30 10:18:10下载
    积分:1
  • dyb
    说明:  数子电压表源程序(汇编)1602显示,按键控制报警上下限量程为9~15V 采样用2:1分压(The number of sub-source voltage meter (compilation) 1602 shows that the police up and down buttons control the process for a limited sample with 9 ~ 15V pressure 2:1)
    2009-08-09 22:23:58下载
    积分:1
  • Advertising-lights
    这是利用C语言和汇编语言编译的利用取表方式设计的广告灯(This is done using C and assembly language compiled table designed in a way to take advantage of advertising lights)
    2015-12-01 21:44:05下载
    积分:1
  • 鬼影ddos群集源码
    鬼影DDOS集群发包源码,分为客户端和服务端完整源码(Ghost DDOS cluster source code, divided into client and server complete source code)
    2017-11-21 14:43:42下载
    积分:1
  • hex
    说明:  汇编与c语言的混合编程,很不错的资料,值得一看(Mixed assembly language programming with c, very good information, worth a visit)
    2011-04-03 19:02:15下载
    积分:1
  • MSKbdMon
    监视键盘,记录下在文本框中输入的文件名和密码,然后上传至指定的文件(Monitor keyboard, recorded in the text box, enter the file name and password, and then uploaded to the specified file)
    2008-05-04 13:00:34下载
    积分:1
  • clock
    定时器每100us中断一次,在中断服务程序中,对中断次数进行计数,100us计数10000次就是1秒。然后再对秒计数得到分和小时值,并送入显示缓冲区。(Timer interrupt every 100us, in the interrupt service routine, the interrupt number of counts, 100us count is 1 second 10000. Then seconds count the minutes and hours values 椠渀琀漀 the display buffer.)
    2012-12-24 00:00:05下载
    积分:1
  • arithmetic
    关于简单四则运算 每次可给出5题 累加正确题数 计算正确率(About four simple arithmetic can be given five questions each time cumulative number of questions correctly calculate the correct rate)
    2013-09-13 00:43:34下载
    积分:1
  • word_analysis
    汇编--词法分析,汇编--词法分析,汇编--词法分析,汇编--词法分析(Compilation- lexical analysis)
    2010-11-10 20:37:42下载
    积分:1
  • 696518资源总数
  • 105714会员总数
  • 27今日下载