#include<iostream>
using namespace std;
//在一个文本串S内查找一个模式串P 的出现位置
/*
暴力搜索法
*/
int violentMatch(char* s, char* p) {
int s_len = strlen(s);
int p_len = strlen(p);
int i = 0, j = 0;
while (i < s_len && j < p_len) {
if (s[i] == p[j]) {
i++;
KMP算法C++实现
最新推荐文章于 2024-04-11 22:29:54 发布