English

Shortest unique palindromic substring queries in optimal time

Data Structures and Algorithms 2017-07-05 v2

Abstract

A palindrome is a string that reads the same forward and backward. A palindromic substring PP of a string SS is called a shortest unique palindromic substring (SUPS\mathit{SUPS}) for an interval [x,y][x, y] in SS, if PP occurs exactly once in SS, this occurrence of PP contains interval [x,y][x, y], and every palindromic substring of SS which contains interval [x,y][x, y] and is shorter than PP occurs at least twice in SS. The SUPS\mathit{SUPS} problem is, given a string SS, to preprocess SS so that for any subsequent query interval [x,y][x, y] all the SUPS\mboxs\mathit{SUPS}\mbox{s} for interval [x,y][x, y] can be answered quickly. We present an optimal solution to this problem. Namely, we show how to preprocess a given string SS of length nn in O(n)O(n) time and space so that all SUPS\mboxs\mathit{SUPS}\mbox{s} for any subsequent query interval can be answered in O(k+1)O(k+1) time, where kk is the number of outputs.

Keywords

Cite

@article{arxiv.1608.05550,
  title  = {Shortest unique palindromic substring queries in optimal time},
  author = {Yuto Nakashima and Hiroe Inoue and Takuya Mieno and Shunsuke Inenaga and Hideo Bannai and Masayuki Takeda},
  journal= {arXiv preprint arXiv:1608.05550},
  year   = {2017}
}
R2 v1 2026-06-22T15:24:12.383Z