搜索
首页 教育/科学 职业教育 职业培训

字符串匹配的算法是怎样的?

字符串匹配的算法是怎样的?

全部回答

2017-08-07

47 0
    字符串匹配 void NaiveStringMatching(char *t,char *p) { int n=Length(t); int m=Length(p); if(n { printf(\"Error:The P is longer than T!\\n\"); return; } bool find=true; printf(\"The string T is %s\\n\",t); printf(\"The string P is %s\\n\",p); for(int s=0;s { if(t[s+i]!=p[i]) { find=false; break; } } if(find) printf(\"Pattern occurs with shift:%d\\n\",s+1); } } int main() { char t[]=\"abcdebcg\"; char p[]=\"bcdebcg\"; NaiveStringMatching(t,p); return 0; }。
    。

类似问题换一批

热点推荐

热度TOP

相关推荐
加载中...

热点搜索 换一换

教育/科学
职业培训
院校信息
升学入学
理工学科
出国/留学
职业教育
人文学科
外语学习
学习帮助
K12
职业教育
职业培训
会计资格考试
远程教育
自考
司法考试
公务员考试
职业培训
职业培训
举报
举报原因(必选):
取消确定举报