Given a string T of length n over an alphabet Σ⊂{1,2,…,nO(1)} of size σ, we are to preprocess T so that given a range [i,j], we can return a representation of a shortest string over Σ that is absent in the fragment T[i]⋯T[j] of T. We present an O(n)-space data structure that answers such queries in constant time and can be constructed in O(nlogσ⁡n) time.

, , ,
doi.org/10.1016/j.tcs.2022.04.029
Theoretical Computer Science
Centrum Wiskunde & Informatica, Amsterdam (CWI), The Netherlands

Badkobeh, G, Charalampopoulos, P, Kosolobov, D, & Pissis, S. (2022). Internal shortest absent word queries in constant time and linear space. Theoretical Computer Science. doi:10.1016/j.tcs.2022.04.029