diff options
| author | MZuenni <michi.zuendorf@gmail.com> | 2023-02-14 16:41:24 +0100 |
|---|---|---|
| committer | MZuenni <michi.zuendorf@gmail.com> | 2023-02-14 16:41:24 +0100 |
| commit | eb4bc75111da45a17604fdff2f9eed0977f93dff (patch) | |
| tree | ffd990c0cc12a73c897a6e5c0d8216ce178a78c5 /string/suffixAutomaton.cpp | |
| parent | f07738a30c46f0a277af5609a3b4c4b01674ad84 (diff) | |
moved more stuff
Diffstat (limited to 'string/suffixAutomaton.cpp')
| -rw-r--r-- | string/suffixAutomaton.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/string/suffixAutomaton.cpp b/string/suffixAutomaton.cpp index 69aa979..4d05b6e 100644 --- a/string/suffixAutomaton.cpp +++ b/string/suffixAutomaton.cpp @@ -11,7 +11,6 @@ struct SuffixAutomaton { SuffixAutomaton(const string &s) : states(2*sz(s)) { size = 1; last = 0; - states[0].length = 0; states[0].link = -1; for (auto c : s) extend(c - MIN_CHAR); } @@ -43,8 +42,7 @@ struct SuffixAutomaton { last = current; } - // Pair with start index and length of LCS. - // Index in parameter t. + // Pair with start index (in t) and length of LCS. pair<int, int> longestCommonSubstring(const string &t) { int v = 0, l = 0, best = 0, bestpos = 0; for (int i = 0; i < sz(t); i++) { |
