摘要: 1.KMP算法解决的问题:两个字符串str1,str2,判断str2是否为str1的字串 * 注:abc是abcde的字串,但abd不是 2.KMP算法过程 (1).先求字符串前缀和后缀都相等的最大长度(该长度一定小于字符串本身的长度) * 例:一个字符串abbab,则其前后缀分别为: * 长度:1 阅读全文
posted @ 2022-04-30 17:17 jue1e0 阅读(49) 评论(0) 推荐(0)
摘要: 并查集的实现代码及解析: 1 public class UnionFind { 2 public static class Element<V> { 3 public V value; 4 5 public Element(V value) { 6 this.value = value; 7 } 8 阅读全文
posted @ 2022-04-30 17:16 jue1e0 阅读(24) 评论(0) 推荐(0)