Computing runs on a trie
A maximal repeat, or run, in a string, is a periodically maximal 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 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 O(n√( n) n) time and O(n) space algorithm for counting and finding the shallower endpoint of all runs. We further show an O(n√( n)^2 n) time and O(n) space algorithm for finding both endpoints of all runs.
READ FULL TEXT