Suffix arrays and LCP arrays are one of the most fundamental data structures widely used for various kinds of string processing. Many problems can be solved efficiently by using suffix arrays, or a pair of suffix arrays and LCP arrays. In this paper, we consider two problems for a read-only string of length $N$, the characters of which are represented as integers in $[1, \dots, \sigma]$ for $1 \leq \sigma \leq N$ and the string contains $\sigma$ distinct characters, the construction of a suffix array, and a simultaneous construction of both the suffix array and LCP array. For the word RAM model, we propose algorithms to solve both of the problems in $O(N)$ time by using $O(1)$ extra words, which are optimal in time and space. Extra words means the required space except for the space of the input string and output suffix array and LCP array. Our contribution improves the previous most efficient algorithms, $O(N)$ time using $\sigma+O(1)$ extra words by [Nong, TOIS 2013] and $O(N \log N)$ time using $O(1)$ extra words by [Franceschini and Muthukrishnan, ICALP 2007] for constructing the suffix arrays, and it improves the previous most efficient solution that runs in $O(N)$ time using $\sigma + O(1)$ extra words for constructing both suffix arrays and LCP arrays through a combination of [Nong, TOIS 2013] and [Manzini, SWAT 2004].
翻译:后缀阵列和 LCP 阵列是广泛用于各种字符串处理的最基本数据结构之一。 许多问题可以通过使用后缀阵列或一对后缀阵列和 LCP 阵列来有效解决。 在本文中, 我们考虑两个只读的长度字符串问题 $N$, 其字符在 $1,\dots,\sigma] 中代表整数, $1\leq\ sigma\ slima\leq N$, 字符串中包含$gma$ ns slus leq N$, 创建后缀阵列阵列和 LCP 阵列。 对于单词 RAM 模式, 我们建议使用$( N) $( 美元) 额外单词来解决$O( 美元) 中的问题。 额外的单词表示所需的空间, 除了输入字符串和输出后缀阵列的空格, (NSlusi) 和LCP $( 美元) 。 我们的贡献改进了前最高效的算, $( N) 2013, 美元 和 rus 美元 时间, 用 美元 美元 和 美元, 美元, 用前 美元 美元, 美元, 美元, 用前的 美元 美元和 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元和 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 和 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 和 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元, 美元,