6
votes
4answers
2k views

Smallest lexicographical rotation of a string using suffix arrays in O(n)

I will quote the problem from ACM 2003: Consider a string of length n (1 <= n <= 100000). Determine its minimum lexicographic rotation. For example, the rotations of the string “alabala” ...