Skip to content

Commit 6e3b224

Browse files
committed
comment fixes.
1 parent 11c606c commit 6e3b224

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

strings/duval.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
* that can be obtained by rotating a string. For example, the rotation
1111
* equivalence class of "abc" is {"abc", "bca", "cab"}. The lexicographically
1212
* smallest string in this class is "abc".
13-
* Duval's algorithm works by finding the lexicographically smallest Lyndon word
14-
* in a string. It does this by iterating over the string and finding the
13+
*
14+
* Duval's algorithm works by iterating over the string and finding the
1515
* smallest rotation of the string that is a Lyndon word. This is done by
1616
* comparing the string with its suffixes and finding the smallest suffix that
1717
* is lexicographically smaller than the string. This suffix is then added to
1818
* the result and the process is repeated with the remaining string.
1919
* The algorithm has a time complexity of O(n) where n is the length of the
2020
* string.
2121
*
22-
* @note While Lyndon word are described in the context of strings,
22+
* @note While Lyndon words are described in the context of strings,
2323
* Duval's algorithm can be used to find the lexicographically smallest cyclic
2424
* shift of any sequence of comparable elements.
2525
*

0 commit comments

Comments
 (0)