Theoretical Computer Science ( IF 0.9 ) Pub Date : 2021-07-15 , DOI: 10.1016/j.tcs.2021.07.011 Ryo Sugahara 1 , Yuto Nakashima 1 , Shunsuke Inenaga 1, 2 , Hideo Bannai 3 , Masayuki Takeda 1
A maximal repetition, or run, in a string, is a maximal periodic substring whose smallest period is at most half the length of the substring. In this paper, we consider runs that correspond to a path on a trie, or in other words, on a rooted edge-labeled tree where each edge is labeled with a single symbol, and the endpoints of the path must be a descendant/ancestor of the other. For a trie with n edges, we show that the number of runs is less than n. We also show an asymptotic lower bound on the maximum density of runs in tries: where is the maximum number of runs in a trie with n edges. Furthermore, we also show an time and space algorithm for finding all runs.
中文翻译:
高效计算在特里运行
字符串中的最大重复或运行是最大周期子串,其最小周期最多为子串长度的一半。在本文中,我们考虑对应于树上路径的运行,或者换句话说,在有根边标记的树上,其中每条边都用单个符号标记,并且路径的端点必须是后代/祖先另一个。对于具有n 条边的 trie ,我们表明运行次数小于n。我们还显示了尝试中最大运行密度的渐近下界: 在哪里 是具有n 条边的 trie 中的最大运行次数。此外,我们还展示了一个 时间和 用于查找所有运行的空间算法。