文件名称:Trie_and_Huffman
-
所属分类:
- 标签属性:
- 上传时间:2017-10-27
-
文件大小:2kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
功能1:使用一种树型结构来实现我们的单词计数功能——Trie树
功能2:Huffman树进行编码
程序输入:
第一行为一个正整数n,表示输入单词的总数。
接下来的n行,每行为一个单词,单词由不超过10个的小写英文字母组成。
接下来的一行为一个正整数m,表示查询的次数。
接下来的m行,每行为一个数字和一个查询,当数字为1时,查询为单词,输出该单词出现的次数(可以为0);当数字为2时,查询为Huffman编码,输出对应的单词(该Huffman编码对应的单词确定存在)。(Function 1: Use a tree structure to implement our word counting function - Trie Trees:
Function 2: The Huffman tree is encoded
Program entry:
The first line is a positive integer n, which represents the total number of words entered.
The next n lines, each line of a word, the word by no more than 10 small letters written in English letters.
The next line is a positive integer m, indicating the number of queries.
The next m rows, each line of a number and a query, when the number is 1, the query for the word, the output of the word appears (can be 0); when the number 2, the query for Huffman coding, the corresponding output The word (the Huffman code corresponds to the word that exists).)
功能2:Huffman树进行编码
程序输入:
第一行为一个正整数n,表示输入单词的总数。
接下来的n行,每行为一个单词,单词由不超过10个的小写英文字母组成。
接下来的一行为一个正整数m,表示查询的次数。
接下来的m行,每行为一个数字和一个查询,当数字为1时,查询为单词,输出该单词出现的次数(可以为0);当数字为2时,查询为Huffman编码,输出对应的单词(该Huffman编码对应的单词确定存在)。(Function 1: Use a tree structure to implement our word counting function - Trie Trees:
Function 2: The Huffman tree is encoded
Program entry:
The first line is a positive integer n, which represents the total number of words entered.
The next n lines, each line of a word, the word by no more than 10 small letters written in English letters.
The next line is a positive integer m, indicating the number of queries.
The next m rows, each line of a number and a query, when the number is 1, the query for the word, the output of the word appears (can be 0); when the number 2, the query for Huffman coding, the corresponding output The word (the Huffman code corresponds to the word that exists).)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.