为提高基于划分窗口的字符串匹配算法(SKIP和KMPSKIP算法)的性能,结合QS算法的优点,通过提前预览下一窗口最后一个字符的移动信息跳过尽可能多的字符进行下一轮匹配,减少了匹配次数,提高了匹配效率.理论分析及实验结果均表明,改进算法在平均时间复杂度方面优于原始算法,在模式较短的情况下,ISKIP算法的平均运行时间仅为BMH算法的65%~85%.
ISKIP and IKMPSKIP algorithms were developed combining quick search(QS) algorithm to improve performance of SKIP and KMPSKIP algorithms using partition window. The shift information of the last character of next window was looked ahead to increase the shift distance, and the times of matching were reduced efficiently. Theoretical analysis shows that two improved algorithms are superior to the original ones in respect of average time complexities. Experimental results also demonstrate its effectiveness. Especially in case of small patterns, ISKIP algorithm takes only 65 % -85 % of time of BMH algorithm.