Algorithms to Compute the Lyndon Array
Algorithms to Compute the Lyndon Array
复制标题
计算 Lyndon 数组的算法
DOI:
--
复制
发表时间:
2016
期刊:
影响因子:
--
通讯作者:
W. F. Smyth
中科院分区:
文献类型:
--
作者:
F. Franek;A. S. M. S. Islam;Mohammad Sohel Rahman;W. F. Smyth
We first describe three algorithms for computing the Lyndon array that have been suggested in the literature, but for which no structured exposition has been given. Two of these algorithms execute in quadratic time in the worst case, the third achieves linear time, but at the expense of prior computation of both the suffix array and the inverse suffix array of x. We then go on to describe two variants of a new algorithm that avoids prior computation of global data structures and executes in worst-case n log n time. Experimental evidence suggests that all but one of these five algorithms require only linear execution time in practice, with the two new algorithms faster by a small factor. We conjecture that there exists a fast and worst-case linear-time algorithm to compute the Lyndon array that is also elementary (making no use of global data structures such as the suffix array).