Added the implementation of Duval's Algorithm for finding the lexicographically smallest cyclic shift of a sequence. The algorithm is based on the concept of Lyndon words and works in O(n) time, making it efficient for this type of task. This implementation is generic and works with various sequence types, such as strings, vectors, arrays, and deques.
Description of Change
Added the implementation of Duval's Algorithm for finding the lexicographically smallest cyclic shift of a sequence. The algorithm is based on the concept of Lyndon words and works in O(n) time, making it efficient for this type of task. This implementation is generic and works with various sequence types, such as strings, vectors, arrays, and deques.
Checklist