-
Notifications
You must be signed in to change notification settings - Fork 744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SuffixTree segfaults #274
Comments
Your |
Thanks but even with this it was segfaulting. int main(void) {
std::string s = "abcde";
std::string t = "cdefg";
SuffixTree *st = new SuffixTree(s + "{" + t + "}");
st->lcs(0, sz(s), sz(s) + 1 + sz(t), 0);
auto result = st->best;
cout << st->best.first << " " << st->best.second << endl;
return 0;
} This works. |
I think the default value allocates too much for most systems? |
Probably the problem is: |
This string "abcde{cdefg}" contains That said, the documentation for this algorithm is confusing. There is a comment about |
Sorry I can explain :) As I edited the code too much. SuffixTree st(s + (char)('z' + 1) + t + (char)('z' + 2)); This requires |
Issues with your code:
- memset(s, 0, sizeof s);
- memset(t, -1, sizeof t);
+ memset(s, 0, N);
+ memset(t, 0, N); You can run |
Any test like
Results in segmentation fault.
The text was updated successfully, but these errors were encountered: