文件名称:huffman
介绍说明--下载内容均来自于网络,请自行研究使用
Huffman编码是最优变长码,请设计一个Huffma编码程序,实现以下功能:
(1)接收原始数据:从终端读入字符集大小n,以及n个字符和权值,建立Huffman 树,并将它文件hfmtree.dat中。
(2)编码:利用已建立的哈夫曼树,对文件中的正文进行编码,将结果存入文件codefile.dat中。
(3)译码:利用已建立号的哈夫曼树将sodefile.dat中的代码进行译码,结果存入文件textfile.dat中。
(4)打印编码规:即字符与编码之间的一一对应关系。
(5)打印Huffman树,将已存入内存中的哈夫曼树以直观的方式显示在终端上。-Huffman coding is optimal variable-length code, the design of a Huffma coding process, realize the following functions: (1) to receive the raw data: Reading from the terminal into the character set size n, and n characters, and the right values, the establishment of Huffman tree, and It documents in hfmtree.dat. (2) Coding: Using the Huffman tree has been established to document the body encode the results into a document in codefile.dat. (3) Decoding: The number has been established Huffman tree will sodefile.dat decoding of code, resulting in a document deposited in textfile.dat. (4) Print coding rules: that is, characters with one-to-one relationship between the encoding. (5) Print Huffman tree will have been deposited in the Huffman tree in memory intuitive way to show that in the terminal.
(1)接收原始数据:从终端读入字符集大小n,以及n个字符和权值,建立Huffman 树,并将它文件hfmtree.dat中。
(2)编码:利用已建立的哈夫曼树,对文件中的正文进行编码,将结果存入文件codefile.dat中。
(3)译码:利用已建立号的哈夫曼树将sodefile.dat中的代码进行译码,结果存入文件textfile.dat中。
(4)打印编码规:即字符与编码之间的一一对应关系。
(5)打印Huffman树,将已存入内存中的哈夫曼树以直观的方式显示在终端上。-Huffman coding is optimal variable-length code, the design of a Huffma coding process, realize the following functions: (1) to receive the raw data: Reading from the terminal into the character set size n, and n characters, and the right values, the establishment of Huffman tree, and It documents in hfmtree.dat. (2) Coding: Using the Huffman tree has been established to document the body encode the results into a document in codefile.dat. (3) Decoding: The number has been established Huffman tree will sodefile.dat decoding of code, resulting in a document deposited in textfile.dat. (4) Print coding rules: that is, characters with one-to-one relationship between the encoding. (5) Print Huffman tree will have been deposited in the Huffman tree in memory intuitive way to show that in the terminal.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
huffman.txt