For an undirected tree with $n$ edges labelled by single letters, we consider its substrings, which are labels of the simple paths between pairs of nodes. We prove that there are $O(n^{1.5})$ different palindromic substrings. This solves an open problem of Brlek, Lafreni\`ere, and Proven\c{c}al (DLT 2015), who gave a matching lower-bound construction. Hence, we settle the tight bound of $\Theta(n^{1.5})$ for the maximum palindromic complexity of trees. For standard strings, i.e., for paths, the palindromic complexity is $n+1$. We also propose $O(n^{1.5} \log{n})$-time algorithm for reporting all distinct palindromes in an undirected tree with $n$ edges.
翻译:对于用单字母标注的无方向树,我们考虑它的子字符串,这是对结点之间简单路径的标签。 我们证明有美元( n ⁇ 1.5}) 美元( $) 不同的平原亚stries。 这解决了Brlek、 Lafreni ⁇ ére 和Proven\c{c}al( DLT 2015) 的未决问题, 后者的构造比起来要低。 因此, 我们解决了树最大边状复杂度的 $\ Theta( n ⁇ 1.5} ) 的紧框。 对于标准字符串, 即路径, 平面复杂度是 $+1$( n+1$ )。 我们还提议用$( { {1.5}\ log{n} 来报告无方向树上的所有不同的近地点 。