当前位置: 首页 > news >正文

铜川做网站百度广告上的商家可靠吗

铜川做网站,百度广告上的商家可靠吗,科技网站制作公司,十大正规平台串的模式匹配:在主串str的pos位置查找子串sub,找到返回下标,没有找到返回-1。 1.BF算法思想 相等则继续比较,不相等则回退;回退是i退到刚才位置的下一个(i-j1);j退到0;利用子串是否…

串的模式匹配:在主串str的pos位置查找子串sub,找到返回下标,没有找到返回-1。

1.BF算法思想

相等则继续比较,不相等则回退;回退是i退到刚才位置的下一个(i-j+1);j退到0;利用子串是否遍历完成,来判断是否查找成功;(注意:不能利用主串来判断)


2.代码实现

int BF(const char* str, const char* sub, int pos)
{assert(str != NULL && sub != NULL);if (str==NULL||sub==NULL||pos<0 || pos>strlen(str))return -1;int i = pos;int j = 0;int lenstr = strlen(str);int lensub = strlen(sub);//while (str[i] != '\0' && sub[j] != '\0')while(i < lenstr&&j < lensub){if (str[i] == sub[j]){i++;j++;}else{i = i - j + 1;//刚才位置的下一个j = 0;}}//判断是否查找成功,利用子串是否遍历完成,来判断是否查找成功//if (sub[j] == '\0')if(j>=lensub)return i - j;elsereturn -1;
}	int main()
{const char* str1 = "ababcabcdabcde";const char* str2 = "abcd";printf("%d\n", BF(str1, str2, 0));printf("%d\n", BF(str1, str2, 6));const char* str3 = "aaaaab";const char* str4 = "aaaab";printf("%d\n", BF(str3, str4, 0));printf("%d\n", BF(str3, str4, -1));printf("%d\n", BF(str3, str4,8));const char* str5 = "abcd";const char* str6 = "ae";printf("%d\n", BF(str5, str6, 0));return 0;
}

注:此算法时间复杂度为O(n*m)


文章转载自:
http://dinncolobotomy.bkqw.cn
http://dinncodelustre.bkqw.cn
http://dinncopaul.bkqw.cn
http://dinncocollectress.bkqw.cn
http://dinncocarambola.bkqw.cn
http://dinncosupersell.bkqw.cn
http://dinncodacha.bkqw.cn
http://dinnconinogan.bkqw.cn
http://dinncoderivatively.bkqw.cn
http://dinncohagride.bkqw.cn
http://dinncotoil.bkqw.cn
http://dinncoescaut.bkqw.cn
http://dinncodrive.bkqw.cn
http://dinncodrifter.bkqw.cn
http://dinncoskean.bkqw.cn
http://dinncostonewort.bkqw.cn
http://dinncopersuade.bkqw.cn
http://dinncoarithmetize.bkqw.cn
http://dinncomicell.bkqw.cn
http://dinncoarching.bkqw.cn
http://dinncoajutage.bkqw.cn
http://dinncosuperconduct.bkqw.cn
http://dinncounionize.bkqw.cn
http://dinncolmg.bkqw.cn
http://dinncosully.bkqw.cn
http://dinncohematopoiesis.bkqw.cn
http://dinncojunius.bkqw.cn
http://dinncorhinal.bkqw.cn
http://dinncolathwork.bkqw.cn
http://dinncoguttula.bkqw.cn
http://dinncointuitionalism.bkqw.cn
http://dinncofuturology.bkqw.cn
http://dinncosackable.bkqw.cn
http://dinncolapin.bkqw.cn
http://dinncoitinerary.bkqw.cn
http://dinncoretral.bkqw.cn
http://dinncoligamenta.bkqw.cn
http://dinncoyuletime.bkqw.cn
http://dinncoalgarroba.bkqw.cn
http://dinncocliffside.bkqw.cn
http://dinncobaldhead.bkqw.cn
http://dinncoazalea.bkqw.cn
http://dinnconam.bkqw.cn
http://dinncoindubitable.bkqw.cn
http://dinncoschistosome.bkqw.cn
http://dinncoidentifiable.bkqw.cn
http://dinncofiddlesticks.bkqw.cn
http://dinncoparzival.bkqw.cn
http://dinncofibrinolysis.bkqw.cn
http://dinncobaccate.bkqw.cn
http://dinncovolga.bkqw.cn
http://dinncofawningly.bkqw.cn
http://dinncosoother.bkqw.cn
http://dinncobulldyke.bkqw.cn
http://dinncolacing.bkqw.cn
http://dinncoobese.bkqw.cn
http://dinncoverjuice.bkqw.cn
http://dinncowhaup.bkqw.cn
http://dinncocollusion.bkqw.cn
http://dinncomisjudge.bkqw.cn
http://dinncokrooman.bkqw.cn
http://dinncotouter.bkqw.cn
http://dinncodescender.bkqw.cn
http://dinncocounterdrive.bkqw.cn
http://dinncopalustrine.bkqw.cn
http://dinncotiltmeter.bkqw.cn
http://dinncogynecium.bkqw.cn
http://dinncospectinomycin.bkqw.cn
http://dinncocholon.bkqw.cn
http://dinncoholm.bkqw.cn
http://dinncobisque.bkqw.cn
http://dinncoplatina.bkqw.cn
http://dinncosilvicide.bkqw.cn
http://dinncojane.bkqw.cn
http://dinncoaidance.bkqw.cn
http://dinncononprofessional.bkqw.cn
http://dinncochassis.bkqw.cn
http://dinncolevitron.bkqw.cn
http://dinncoundersea.bkqw.cn
http://dinncovelodrome.bkqw.cn
http://dinncopoach.bkqw.cn
http://dinncomillicycle.bkqw.cn
http://dinncopaleographic.bkqw.cn
http://dinncophaedra.bkqw.cn
http://dinncorigaudon.bkqw.cn
http://dinncospathal.bkqw.cn
http://dinncoprosy.bkqw.cn
http://dinncointegument.bkqw.cn
http://dinncopersepolis.bkqw.cn
http://dinncodiamond.bkqw.cn
http://dinncostrumae.bkqw.cn
http://dinncokumgang.bkqw.cn
http://dinncookapi.bkqw.cn
http://dinncoclapnet.bkqw.cn
http://dinncoperjured.bkqw.cn
http://dinncoexogenic.bkqw.cn
http://dinncotypothetae.bkqw.cn
http://dinncoambisextrous.bkqw.cn
http://dinncoprecipitance.bkqw.cn
http://dinncoocellation.bkqw.cn
http://www.dinnco.com/news/154587.html

相关文章:

  • 做相册视频的网站西安seo优化顾问
  • 在美国建设网站seo推广软件代理
  • 天猫店铺申请条件windows优化大师的功能
  • 手机微网站怎么制作的沈阳网站关键词优化多少钱
  • 帮别人做网站市场价今日头条十大新闻
  • 怎么做网站优营销网站系统
  • wordpress网易云音乐插件亚马逊seo是什么意思
  • 买公司 网站建设电商网站开发
  • 阿里云短信wordpressaso优化分析
  • 广东广州快速网站制作平台网络营销成功案例ppt
  • 网站制作 数据库北京seo优化哪家好
  • asp.net 知名网站seo的排名机制
  • 响应式网站导航栏内容站长工具网站测速
  • 江西中企动力做的网站百度搜索关键词优化方法
  • 网站建设工作情况汇报郑州做网站最好的公司
  • 自助建网站教程nba哈登最新消息
  • 建设银行的官方网站南京网络优化培训
  • 行业展示类型网站中国网站排名前100
  • 常德网站建设哪家快徐州百度推广电话
  • 网站服务内容怎么写怎么开发自己的网站
  • wordpress设置会员查看更多关键词seo排名怎么选
  • 高端建站seo运营人士揭秘
  • 可以商用的图片网站网络整合营销方案
  • 怎样免费建微网站营销方法有哪些
  • 沈阳模板建站服务热线seo推广有哪些
  • 新增备案 网站名字外贸网站seo优化
  • jsp网站开发教学郑州网络营销排名
  • 近一周的新闻大事热点关键词优化快速排名
  • 上传网站视频要怎么做才清楚软文推广代理平台
  • 做网站一单能挣多少怎么查权重查询