TCS Journal 2026 Journal Article
Internal quasiperiod queries
- Maxime Crochemore
- Costas S. Iliopoulos
- Jakub Radoszewski
- Wojciech Rytter
- Juliusz Straszyński
- Tomasz Waleń
- Wiktor Zuba
Internal pattern matching requires one to answer queries about factors of a given string. Many results are known on answering internal period queries, asking for the periods of a given factor. In this paper we investigate internal queries asking for covers (also known as quasiperiods) of a given factor. Let n denote the length of the string and m denote the length of the factor in question. We propose a data structure that answers such queries in O ( log m ) time for the shortest cover and in O ( log m log log m ) time for a representation of all the covers, after O ( n log n ) time and space preprocessing. This is a full version of a conference paper at SPIRE 2020 with query complexities improved by a log log n-factor and additional applications.