摘要:        
Assume that string A is the substring of string B if and only if we can find A in B, now we have a string A and another string B, your task is to find a A in B from B's left side to B's right side, and delete it from B till A is not a substring of B, then output the number of times you do th    阅读全文
        
            posted @ 2012-08-27 20:32
crying_Dream
阅读(427)
评论(0)
推荐(0)
        
            
        
        
摘要:        
发现KMP, 我都已经忘了,找到我之前写的总结,粘贴一下,保存留念吧; 发现之前我写的总结和你好玩的样子,自己都看笑了...hia hia hia hia...KMP我只了解你一点点KMP:即串模式匹配,(KMP分别是三个人名字的简称)。学习KMP推荐:严蔚敏数据结构课件。真心说她讲的很到位。能让你明白next[],的求法。简单算法基本思想(当字符串长度不大时):用i, j指主串和模式串。通过一个个比较,直至模式串与主串一一匹配则称匹配成功,否则失败。改进办法:不用将i指针一次次回朔,而是利用以匹配的结果是是模式串尽可能的向前滑动。 这里需要一个next[100], 的函数。函数模板:K...    阅读全文
        
            posted @ 2012-08-27 20:20
crying_Dream
阅读(190)
评论(0)
推荐(0)
        
                    
                
        
浙公网安备 33010602011771号