摘要:
朴素匹配算法 KMP算法 字符串前后缀 字符关系 执行过程 js //i指针不必回溯 //next[j]表示回溯位置 / 规则1:没有公共前后缀的情况,匹配失败时j = 0去匹配 s: a b (c) d e f g t: a b (d) t串中a与后边的bd串都不相等,在d匹配c失败时,可以知道t 阅读全文
摘要:
创建队列 使用ES6改造 最小优先队列 js function PriorityQueue(){ let items = [] function QueueElement(element,priority){ this.element = element this.priority = priori 阅读全文