文件名称:huffmantree
介绍说明--下载内容均来自于网络,请自行研究使用
利用哈夫曼编码进行信息通信可以大大提高信道利用率,缩短信息传输时间,降低传输成本。但是,这要求在发送端通过一个编码系统对待传数据预先编码,在接收端将传来的数据进行译码(复原)。对于双工信道(即可以双向传输信息的信道),每端都需要一个完整的编/译码系统。试为这样的信息收发站写一个哈夫曼编/译码系统。
基本要求:一个完整的系统应具有以下功能:
(1)初始化(Initialization)。从终端读入字符集大小n,以及n个字符和n个权值,建立哈夫曼树,(选做:并将它存于文件hfmTree中)。并显示出每个字符的编码。
(2)编码(Encoding)。利用已建好的哈夫曼树(选做:如不在内存,则从文件htmTree中读入),对输入的字符串文本(选做:对文件ToBeTran中的正文)进行编码,(选做:然后将结果存入文件CodeFile中。)并显示在屏幕上。
(3)译码(Decoding)。利用已建好的哈夫曼树将输入的代码进行译码(选做:将文件CodeFile中的代码进行译码,结果存入文件TextFile中。),并显示在屏幕上。
(4)打印哈夫曼树(Tree Printing)。将已在内存中的哈夫曼树以直观的方式显示在屏幕上。
-Huffman coding information and communication can greatly improve the channel utilization, reduced transmission time, reducing transmission costs. However, this requires the sending end through a coding system for pre-treatment data encoding, the receiver will decode the data transmitted (recovery). For duplex channel (ie, two-way transmission of information channels), each side needs a complete encoder/decoder system. Test for such information transceiver station to write a Huffman encoding/decoding system.
Basic requirements: a complete system should have the following features:
(1) initialization (Initialization). Read from the terminal character set size n, and n and n characters right value, establishes a Huffman tree, (Optional: and it is stored in the file hfmTree in). And shows the coding of each character.
(2) encoding (Encoding). Has been built using the Huffman tree (Optional: if not in memory, reads from the file htmTree), the input string literal (Optional: The text of t
基本要求:一个完整的系统应具有以下功能:
(1)初始化(Initialization)。从终端读入字符集大小n,以及n个字符和n个权值,建立哈夫曼树,(选做:并将它存于文件hfmTree中)。并显示出每个字符的编码。
(2)编码(Encoding)。利用已建好的哈夫曼树(选做:如不在内存,则从文件htmTree中读入),对输入的字符串文本(选做:对文件ToBeTran中的正文)进行编码,(选做:然后将结果存入文件CodeFile中。)并显示在屏幕上。
(3)译码(Decoding)。利用已建好的哈夫曼树将输入的代码进行译码(选做:将文件CodeFile中的代码进行译码,结果存入文件TextFile中。),并显示在屏幕上。
(4)打印哈夫曼树(Tree Printing)。将已在内存中的哈夫曼树以直观的方式显示在屏幕上。
-Huffman coding information and communication can greatly improve the channel utilization, reduced transmission time, reducing transmission costs. However, this requires the sending end through a coding system for pre-treatment data encoding, the receiver will decode the data transmitted (recovery). For duplex channel (ie, two-way transmission of information channels), each side needs a complete encoder/decoder system. Test for such information transceiver station to write a Huffman encoding/decoding system.
Basic requirements: a complete system should have the following features:
(1) initialization (Initialization). Read from the terminal character set size n, and n and n characters right value, establishes a Huffman tree, (Optional: and it is stored in the file hfmTree in). And shows the coding of each character.
(2) encoding (Encoding). Has been built using the Huffman tree (Optional: if not in memory, reads from the file htmTree), the input string literal (Optional: The text of t
(系统自动生成,下载前可以参看下载内容)
下载文件列表
哈夫曼编码(完)
................\abc.txt
................\哈夫曼编码(完).TXT