A closed string u is either of length one or contains a non-empty border that occurs only as a prefix and as a suffix in u and nowhere else within u. In this paper, we present fast 𝒪(nlog n) time algorithms to compute all 𝒪(n^2) closed substrings by introducing a compact representation for all closed substrings of a string w[1..n], using only 𝒪(n log n) space. These simple and space-efficient algorithms also compute maximal closed strings. Furthermore, we compare the performance of these algorithms and identify classes of strings where each performs best. Finally, we show that the exact number of maximal closed substrings in a Fibonacci word f_n , for n ≥ 5 , is ≈( 1 + 1/ϕ ^2) F_n ≈ 1.382 F_n , where ϕ is the golden ratio and F_n = |f_n| .
更多
查看译文
关键词
Closed strings,Maximal closed substrings,Fibonacci words