知识卡片
线性后缀排序先处理三分之二起点
线性时间后缀数组方案按起点模3分组:余1、余2的是样本后缀,余0的是非样本后缀。
先排序约三分之二的样本,再借其秩排序余下三分之一,最后合并;递归步骤与线性合并的证明留后续问题。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第32章 字符串匹配 · 查看原书依据
The idea behind the linear-time algorithm is to compute the suffix array for the suffixes starting at 2/3 of the positions in the text, recursing as needed, use the resulting information to sort the suffixes starting at the remaining 1/3 of the positions, and then merge the sorted information in linear time to produce the full suffix array. For i = 1, 2,
参考来源
- 位置:《算法导论(第4版)》第32章《字符串匹配》(OEBPS/chapter032.xhtml,文本字符[85000,90000))。
- 结论依据:原文第32.5节复杂度、LCP算法与引理,或章末问题32-1/32-2给出的定义与构造步骤。
- 原始内容:The idea behind the linear-time algorithm is to compute the suffix array for the suffixes starting at 2/3 of the positions in the text, recursing as needed, use the resulting information to sort the suffixes starting at the remaining 1/3 of the positions, and then merge the sorted information in linear time to produce the full suffix array. For i = 1, 2, …, n , if i mod 3 equals 1 or 2, then i is a sample position , and the suffixes starting at such positions are sample suffixes . Positions 3, 6, 9, … are nonsample positions , and the suffixes starting at nonsample positions are nonsample suffixes . The algorithm sorts the sample suffixes, sorts the nonsample suffixes (aided by the result of sorting