登录
首页 » Visual C++ » huffman

huffman

于 2010-03-09 发布 文件大小:7KB
0 234
下载积分: 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 个回复

  • asmmodel
    易语言汇编模块源码 献给新手学习. 支持所有汇编代码(Easy assembly language source module dedicated to novice learning. Support for all assembly code)
    2010-02-17 07:52:44下载
    积分:1
  • DMX512
    DMX512数据协议、DMX512控制协议及其实现、舞台灯光控制技术与DMX512(DMX512 data protocol, DMX512 control protocol and its implementation, stage lighting control technology and DMX512)
    2020-10-10 14:37:34下载
    积分:1
  • liushuideng
    真正的流水灯:(1)第1,3,5,7个灯半亮,其余的全亮。 (2)第1个亮1/8,第2个亮2/8,第3个亮3/8,第4个亮4/8,第5个亮5/8,第6个亮6/8,第7个亮7/8,第8个全亮。 (3)来点小难的,所有的灯逐渐从暗到全亮,再由全亮到暗。 (4)最难的:8个灯从第一个开始依次渐亮,直到最后一个。再从最后一个起渐暗,直到第一个。如此循环往复。这才是真正的流水灯。 (The real light of the water: (1), paragraphs 1, 3, 5, 7 semi-bright lights, the rest of the bright. (2) a bright 1/8, 2 bright 2/8, 3 bright 3/8, 4 bright 4/8, 5 bright 5/8, 6 bright 6/8 7 bright 7/8, 8 full-bright. (3) to a little difficult, all the lights gradually from dark to full brightness, and then from full bright to dark. (4) the hardest: 8 light from the first start in turn gradually brighter, until the last one. From the last one from the dark, until the first. So on ad infinitum. This is true of light water.)
    2012-05-19 12:03:12下载
    积分:1
  • IntelMMx
    想做高效的程序吗?mmx指令集,及常用c程序优化,等你来学(want efficient procedure? Mmx instruction set, and common procedures c optimization, you have to learn)
    2007-05-16 15:28:15下载
    积分:1
  • OK-OK
    Bacom use mmc not test very fast
    2020-06-19 19:20:02下载
    积分:1
  • 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
  • 2
    说明:  形参只是形式参数,并不参与实际运算,但是形参在同一个函数里要相同,实参是实际参数,参与实际的运算, 有几个形参就对应有几个实参,形参在自定义函数里,实参在主函数里 (Formals only formal parameter is not involved in the actual operation, but parameter in a function to be the same, the argument is the actual parameters involved in the actual operation, several shape parameters corresponding to several arguments, parameter in Custom function, the argument in the main function)
    2012-10-01 22:42:31下载
    积分:1
  • C-Technique
    C语言是一种计算机程序设计语言,它既具有高级语言的特点,又具有汇编语言的特点。它的功能性非常强大,目前是各高校的一门必修课。并且市场上许多软件也是基于C语言的平台而产生的,所以C语言在大学中的教学也称得上是"不遗余力"。但是近些年很多的学生普遍反映C语言晦涩难懂,不容易学透,非常努力的学最后却得不能心满意足,课程过后一无所获,甚至一个小小的程序都写不出来,于是针对这些情况就做出一些初步的分析,并且从C语言编程技巧上提出相关的改善对策。 (C language is a computer programming language, both with advanced language features, but also has characteristics of assembly language. Its function is very powerful, is now a required course in colleges and universities. And also a lot of software on the market based on the C language, platform and produce, so C language teaching at the university is also described as a "spare no effort." But in recent years, a lot of students generally reflect the C language obscure, not easy to learn thoroughly, very hard to learn, but finally could not have satisfied the course after nothing, even a small program that can not write, so for these situations to to make some preliminary analysis, and from the C programming language skills relevant improvement measures put forward.)
    2013-10-08 20:40:35下载
    积分:1
  • hex
    说明:  汇编与c语言的混合编程,很不错的资料,值得一看(Mixed assembly language programming with c, very good information, worth a visit)
    2011-04-03 19:02:15下载
    积分:1
  • 696518资源总数
  • 105279会员总数
  • 10今日下载