MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / naive_suffix_array

Class naive_suffix_array

code/strings/suffix_array.test.cpp:13–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11};
12
13struct naive_suffix_array {
14 string s;
15 int n;
16 int *idx;
17
18 // naive_suffix_array(string s) : s(s + "\x0c"), n(size(s)+1) {
19 naive_suffix_array(string _s) : s(_s), n(size(s)) {
20 idx = new int[n];
21 for (int i = 0; i < n; i++) idx[i] = i;
22 sort(idx, idx + n, cmp(idx,s));
23 }
24};
25
26void make_sure_ok(string s) {
27 // s = s + "~";

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected