Linear Time Runs over General Ordered Alphabets
A run in a string is a maximal periodic substring. For example, the string contains the runs = ()^3/2 and = ^2. There are less than n runs in any length-n string, and computing all runs for a string over a linearly-sortable alphabet takes šŖ(n) time (Bannai et al., SODA 2015). Kosolobov conjectured that there also exists a linear time runs algorithm for general ordered alphabets (Inf. Process. Lett. 2016). The conjecture was almost proven by Crochemore et al., who presented an šŖ(nĪ±(n)) time algorithm (where Ī±(n) is the extremely slowly growing inverse Ackermann function). We show how to achieve šŖ(n) time by exploiting combinatorial properties of the Lyndon array, thus proving Kosolobov's conjecture.
READ FULL TEXT