Skip to content

Output-Sensitive Enumeration of Maximal Closed Substrings in Linear Space

Johannes Fischer, Dominik Köppl

cs.DS

Abstract

We revisit the output-sensitive enumeration of maximal closed substrings (MCSs). Given a string of length nn over an integer alphabet, let kk denote its number of MCS occurrences. We combine a right-to-left sweep on the string with range-successor queries to obtain all MCSs with two deterministic word-RAM bounds: for any fixed ε>0\varepsilon>0, we can report all MCSs in O(nlog⁡n+klog⁡εn)O(n\sqrt{\log n}+k\log^\varepsilon n) time using O(n)O(n) words of space, or in O(nlog⁡n+klog⁡log⁡n)O(n\sqrt{\log n}+k\log\log n) time using O(nlog⁡log⁡n)O(n\log\log n) words. Both bounds include preprocessing and report occurrences by their endpoints. In particular, these algorithms improve the known O(nlog⁡n)O(n\log n) worst-case time bound for sufficiently small output.

Create a lesson