summaryrefslogtreecommitdiff
path: root/string/suffixAutomaton.cpp
diff options
context:
space:
mode:
authorMZuenni <michi.zuendorf@gmail.com>2023-02-14 16:41:24 +0100
committerMZuenni <michi.zuendorf@gmail.com>2023-02-14 16:41:24 +0100
commiteb4bc75111da45a17604fdff2f9eed0977f93dff (patch)
treeffd990c0cc12a73c897a6e5c0d8216ce178a78c5 /string/suffixAutomaton.cpp
parentf07738a30c46f0a277af5609a3b4c4b01674ad84 (diff)
moved more stuff
Diffstat (limited to 'string/suffixAutomaton.cpp')
-rw-r--r--string/suffixAutomaton.cpp4
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++) {