用自动机解决字符串的匹配问题

#include<iostream>using namespace std;int jmpoftable[100][256];void Greattable(const char* str, int lenght)//跳转表的建立{ int i = 0; for(const char *p = str; i<lenght; ++p,++i) { jmpoftable[i][*p] = i+1; } for(int j = 1; j <= i; ++j) { int k = 0; while(str[...
默认分类 | 2011-03-17 08:59 | 阅读 1404 次 | 评论 0 条
浏览30055次