Article ID | Journal | Published Year | Pages | File Type |
---|---|---|---|---|
427066 | Information Processing Letters | 2016 | 4 Pages |
•We connect the longest common extension (LCE) problem with the runs computation.•On a general ordered alphabets, all known LCE require O(nlogn)O(nlogn) preprocessing.•Fast LCE on a general alphabet implies a fast runs computation.•We construct an algorithm that computes O(n)O(n) LCE queries in O(n(logn)23) time.•Using the fast LCE, we compute all runs in O(n(logn)23) time.
We describe a RAM algorithm computing all runs (maximal repetitions) of a given string of length n over a general ordered alphabet in O(nlog23n) time and linear space. Our algorithm outperforms all known solutions working in Θ(nlogσ)Θ(nlogσ) time provided σ=nΩ(1)σ=nΩ(1), where σ is the alphabet size. We conjecture that there exists a linear time RAM algorithm finding all runs.