0
点赞
收藏
分享

微信扫一扫

BF算法(c++)

中间件小哥 2022-02-15 阅读 34
	int bf(str s)
	{
		int i = 0, j = 0, index = 0;
		while (arr[i] != '\0' && s.arr[j]!='\0')
		{
			if (arr[i] == s.arr[j])
			{
				i++;
				j++;
			}
			else
			{
				index++;
				i = index;
				j = 0;
			}
		}
		if (s.arr[j] == '\n')
		{
			return index;
		}
		return index;
	}

本算法的类在上一篇文章

举报

相关推荐

字符串匹配算法(BF)(c++)

BF算法

用c语言实现BF算法

C++中串BF模式匹配法

BF算法模式匹配

串的定义及BF算法

0 条评论