首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > KMP

KMP

  • 资源大小:211.02 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: c

资 源 简 介

#include #include #include //朴素查找算法 //在主串str中查找子串sub int BF(const char *str,const char *sub,int pos)//O(n*m) {  int lenstr = strlen(str);  int lensub = strlen(sub);  if(pos<0 || pos>lenstr)  {   return -1;  }  int i = pos;  int j = 0;  while(i= lensub)//找到了  {   return i-j;  }  else  {   return -1;

文 件 列 表

KMP
KMP.cpp
KMP1.png
KMP2.png
KMP3.png
KMP4.png
KMP5.png
KMP6.png
VIP VIP
0.180208s