文件名称:KMP
- 所属分类:
- 数据结构常用算法
- 资源属性:
- [Windows] [Visual.Net] [源码]
- 上传时间:
- 2016-07-14
- 文件大小:
- 1.78mb
- 下载次数:
- 0次
- 提 供 者:
- 李**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
KMP算法实现,能够实现字符串匹配。
输入
第一行一个整数N,表示测试数据组数。
接下来的N*2行,每两行表示一个测试数据。在每一个测试数据中,第一行为模式串,由不超过10^4个大写字母组成,第二行为原串,由不超过10^6个大写字母组成。
其中N< 20
输出
对于每一个测试数据,按照它们在输入中出现的顺序输出一行Ans,表示模式串在原串中出现的次数。-KMP algorithm, to achieve string matching.
nput
The first line is an integer N, indicating the number of test data sets.
The next N*2 lines, each of the two lines that a test data. In each test data, the first behavior pattern string, by no more than 10^4 capital letters, second behavior of the original string, by no more than 10^6 capital letters.
Among them N< 20
output
For each test data, in accordance with the order in which they appear in the input line Ans, the number of times that the pattern string appears in the original string.
输入
第一行一个整数N,表示测试数据组数。
接下来的N*2行,每两行表示一个测试数据。在每一个测试数据中,第一行为模式串,由不超过10^4个大写字母组成,第二行为原串,由不超过10^6个大写字母组成。
其中N< 20
输出
对于每一个测试数据,按照它们在输入中出现的顺序输出一行Ans,表示模式串在原串中出现的次数。-KMP algorithm, to achieve string matching.
nput
The first line is an integer N, indicating the number of test data sets.
The next N*2 lines, each of the two lines that a test data. In each test data, the first behavior pattern string, by no more than 10^4 capital letters, second behavior of the original string, by no more than 10^6 capital letters.
Among them N< 20
output
For each test data, in accordance with the order in which they appear in the input line Ans, the number of times that the pattern string appears in the original string.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
KMP\Debug\KMP.exe
...\.....\KMP.ilk
...\.....\KMP.pdb
...\KMP\Debug\KMP.log
...\...\.....\....tlog\CL.read.1.tlog
...\...\.....\........\CL.write.1.tlog
...\...\.....\........\KMP.lastbuildstate
...\...\.....\........\link.read.1.tlog
...\...\.....\........\link.write.1.tlog
...\...\.....\main.obj
...\...\.....\vc120.idb
...\...\.....\vc120.pdb
...\...\KMP.vcxproj
...\...\KMP.vcxproj.filters
...\...\main.cpp
...\KMP.sdf
...\KMP.sln
...\KMP.v12.suo
...\...\Debug\KMP.tlog
...\...\Debug
...\Debug
...\KMP
KMP