Abstract
The longest common extension problem (LCE problem) is to construct a data structure for an input string \(T\) of length \(n\) that supports \({\mathrm {LCE}}(i,j)\) queries. Such a query returns the length of the longest common prefix of the suffixes starting at positions \(i\) and \(j\) in \(T\). This classic problem has a well-known solution that uses \(\mathcal {O}(n)\) space and \(\mathcal {O}(1)\) query time. In this paper we show that for any trade-off parameter \(1 \le \tau \le n\), the problem can be solved in \(\mathcal {O}(\frac{n}{\tau })\) space and \(\mathcal {O}(\tau )\) query time. This significantly improves the previously best known time-space trade-offs, and almost matches the best known time-space product lower bound.
P. Bille— Supported by the Danish Research Council and the Danish Research Council under the Sapere Aude Program (DFF 4005-00267).
I. L. Gørtz— Research partly supported by Mikkel Thorup’s Advanced Grant from the Danish Council for Independent Research under the Sapere Aude research career programme and the FNU project AlgoDisc - Discrete Mathematics, Algorithms, and Data Structures.
H. W. Vildhøj— This research was supported by a Grant from the GIF, the German-Israeli Foundation for Scientific Research and Development, and by a BSF grant 2010437.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Amir, A., Lewenstein, M., Porat, E.: Faster algorithms for string matching with k mismatches. J. Algorithms 50(2), 257–275 (2004)
Bille, P., Gørtz, I.L., Sach, B., Vildhøj, H.W.: Time-space trade-offs for longest common extensions. J. Discret. Algorithms 25, 42–50 (2014)
Bille, P., Gørtz, I.L., Knudsen, M.B.T., Lewenstein, M., Vildhøj, H.W.: Longest common extensions in sublinear space. arXiv:1504.02671(2015)
Cole, R., Hariharan, R.: Approximate string matching: a simpler faster algorithm. SIAM J. Comput. 31(6), 1761–1782 (2002)
Fine, N.J., Wilf, H.S.: Uniqueness theorems for periodic functions. Proc. AMS 16(1), 109–114 (1965)
Gusfield, D., Stoye, J.: Linear time algorithms for finding and representing all the tandem repeats in a string. J. Comput. Syst. Sci. 69, 525–546 (2004)
Harel, D., Tarjan, R.E.: Fast algorithms for finding nearest common ancestors. SIAM J. Comput. 13(2), 338–355 (1984)
Kärkkäinen, T.I J., Kempa, D.: Faster sparse suffix sorting. In: Proceedings of 31st STACS, vol. 25, pp. 386–396, Dagstuhl, Germany (2014)
Karp, R.M., Rabin, M.O.: Efficient randomized pattern-matching algorithms. IBM J. Res. Dev. 31(2), 249–260 (1987)
Kolpakov, R., Kucherov, G.: Searching for gapped palindromes. In: Ferragina, P., Landau, G.M. (eds.) CPM 2008. LNCS, vol. 5029, pp. 18–30. Springer, Heidelberg (2008)
Landau, G.M., Myers, E.W., Schmidt, J.P.: Incremental string comparison. SIAM J. Comput. 27(2), 557–582 (1998)
Landau, G.M., Schmidt, J.P.: An algorithm for approximate tandem repeats. J. Comput. Biol. 8(1), 1–18 (2001)
Landau, G.M., Vishkin, U.: Fast parallel and serial approximate string matching. J. Algorithms 10, 157–169 (1989)
Main, M.G., Lorentz, R.J.: An O (n log n) algorithm for finding all repetitions in a string. J. Algorithms 5(3), 422–432 (1984)
Manacher, G.: A new linear-time “On-Line” algorithm for finding the smallest initial palindrome of a string. J. ACM 22(3), 346–351 (1975)
Myers, E.W.: An \(O(ND)\) difference algorithm and its variations. Algorithmica 1(2), 251–266 (1986)
Weiner, P.: Linear pattern matching algorithms. In: Proceedings of 14th FOCS (SWAT), pp. 1–11 (1973)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Bille, P., Gørtz, I.L., Knudsen, M.B.T., Lewenstein, M., Vildhøj, H.W. (2015). Longest Common Extensions in Sublinear Space. In: Cicalese, F., Porat, E., Vaccaro, U. (eds) Combinatorial Pattern Matching. CPM 2015. Lecture Notes in Computer Science(), vol 9133. Springer, Cham. https://doi.org/10.1007/978-3-319-19929-0_6
Download citation
DOI: https://doi.org/10.1007/978-3-319-19929-0_6
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-19928-3
Online ISBN: 978-3-319-19929-0
eBook Packages: Computer ScienceComputer Science (R0)