LCP Array Construction Using O(sort(n)) (or Less) I/Os
LCP Array Construction Using O(sort(n)) (or Less) I/Os
复制标题
使用 O(sort(n))(或更少)I/O 构建 LCP 数组
DOI:
10.1007/978-3-319-46049-9_20
复制
发表时间:
2016
影响因子:
0.5
通讯作者:
Dominik Kempa
中科院分区:
文献类型:
--
作者:
Juha Kärkkäinen;Dominik Kempa
The suffix array, one of the most important data structures in modern string processing, needs to be augmented with the longest-common-prefix (LCP) array in many applications. Their construction is often a major bottleneck especially when the data is too big for internal memory. While there are external memory algorithms that construct the suffix array and the LCP array simultaneously in the optimal I/O complexity of \(\mathcal {O}\!\left( {\mathrm {sort}\!\left( {n} \right) } \right) \), for several reasons it would be desirable to construct the suffix array first and then the LCP array from the suffix array in a separate stage. In this paper we describe the first algorithm that achieves \(\mathcal {O}\!\left( {\mathrm {sort}\!\left( {n} \right) } \right) \) I/O complexity for the LCP array construction stage and is not an extension of a suffix sorting algorithm. As a variant, we obtain a Monte Carlo algorithm that, given a sparse suffix array containing \(m < n\) suffixes in sorted order, computes the corresponding LCP array in \(\mathcal {O}\!\left( {\mathrm {scan}\!\left( {n} \right) +\mathrm {sort}\!\left( {m} \right) \log (n/m)} \right) \) I/Os if the suffix positions are evenly spaced, and in \(\mathcal {O}\!\left( {\mathrm {scan}\!\left( {n} \right) +\mathrm {sort}\!\left( {m} \right) \log (n)} \right) \) I/Os in general.