当我了解时,我正在用Python实现用于子字符串搜索的。我在网上搜索过Galil规则,但我只找到了几个句子,而且我无法访问原始文件。如何将其实现到当前的算法中?while i < (N - M + 1): for j in reversed(range(0, M)): skip = max(1, j - offsets[text[i+j]]) if skip == 0:
return
我目前正在试验一种非常简单的Boyer变体。结果是一致的,即运行相同的测试多次产生相同的错误。string src("This haystack contains a needle! needless to say that only 2 matches need to be found!");const char* res = src.c_str();
whi