DeepAI AI Chat
Log In Sign Up

Computing runs on a trie

by   Ryo Sugahara, et al.

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.


page 1

page 2

page 3

page 4


A Time-space Trade-off for Computing the Geodesic Center of a Simple Polygon

In this paper we study the problem of computing the geodesic center of a...

Linear Time Runs over General Ordered Alphabets

A run in a string is a maximal periodic substring. For example, the stri...

Linear-Time Online Algorithm Inferring the Shortest Path from a Walk

We consider the problem of inferring an edge-labeled graph from the sequ...

Computing palindromes on a trie in linear time

A trie 𝒯 is a rooted tree such that each edge is labeled by a single cha...

Time- and space-optimal algorithms for the many-visits TSP

The many-visits traveling salesperson problem (MV-TSP) asks for an optim...

Variance of Longest Run Duration in a Random Bitstring

We continue an earlier study, starting with unconstrained n-bitstrings, ...

Typically-Correct Derandomization for Small Time and Space

Suppose a language L can be decided by a bounded-error randomized algori...