文件名称:Trie_and_Huffman
- 所属分类:
- 数据结构常用算法
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2017-10-31
- 文件大小:
- 2kb
- 下载次数:
- 0次
- 提 供 者:
- functio*******
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
功能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).)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Trie_and_Huffman
Trie_and_Huffman\Huffman.h
Trie_and_Huffman\main.cpp
Trie_and_Huffman\Trie.h
Trie_and_Huffman\Huffman.h
Trie_and_Huffman\main.cpp
Trie_and_Huffman\Trie.h