A trie $\mathcal{T}$ is a rooted tree such that each edge is labeled by a single character from the alphabet, and the labels of out-going edges from the same node are mutually distinct. Given a trie $\mathcal{T}$ with $n$ edges, we show how to compute all distinct palindromes and all maximal palindromes on $\mathcal{T}$ in $O(n)$ time, in the case of integer alphabets of size polynomial in $n$.This improves the state-of-the-art $O(n \log h)$-time algorithms by Funakoshi et al. [PCS 2019], where $h$ is the height of $\mathcal{T}$. Using our new algorithms, the eertree with suffix links for a given trie $\mathcal{T}$ can readily be obtained in $O(n)$ time. Further, our trie-based $O(n)$-space data structure allows us to report all distinct palindromes and maximal palindromes in a query string represented in the trie $\mathcal{T}$, in output optimal time. This is an improvement over an existing (na\"ive) solution that precomputes and stores all distinct palindromes and maximal palindromes for each and every string in the trie $\mathcal{T}$ separately, using a total $O(n^2)$ preprocessing time and space, and reports them in output optimal time upon query.
翻译: trie $\ mathcal{T} 美元是根树, 这样每个边缘都由字母中的单一字符标注, 而同一节点中过期边缘的标签是截然不同的。 如果一个有美元边缘的 trie $\ mathcal{T} 美元, 我们展示了如何用$\ mathcal{T} 美元来计算所有不同的调色板和所有最大调色板, $(n) 美元, 以美元表示大小的整数正数字母 。 此外, 我们基于本地的 $( n) 美元, 并且由 Funakoshi 和 Al 来改进当前边端端点的调色调值 。 [PCS 2019, 美元是美元, 其中的顶值是$ 。 使用我们新的算法, 给定的 $\ mathal 链接的eertreetre {T$, 也可以用$( n) 时间获得 $ 。 此外, 我们基于本地的 $ (n) $- cal- cal- cal_ cal_ deal_ deal_ dal_ dal dal dal drodrodrodro), 和在目前的所有 格式中, 数据结构中, 格式中, 和在每分钟中以所有不同的调 $ 和 ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex exdrdrdrut ex ex ex ex exdrut ex ex ex ex ex ex exdrutrut ex ex exdrut ex dri ex dri 和 exdrut ex ex ex ex ex ex exal dal dal dal dal dal dal dal dal dal dal ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex ex