字符串匹配的KMP算法——Python实现
摘要:#! /usr/bin/python# coding=utf-8"""基于这篇文章的python实现http://blog.sae.sina.com.cn/archives/307"""import unittestdef pmt(s): """ PartialMatchTable """ prefix = [s[:i+1] for i in range(len(s)-1)] postfix = [s[i+1:] for i in range(len(s)-1)] inter
        阅读全文
        
            posted @ 2013-09-01 21:16
 
                    
                     
                    
                 
                    
                 
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号