MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / get_lcp

Method get_lcp

Strings/Suffix Array Isomorphic.cpp:91–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 return min(t[l][k], t[r - (1 << k) + 1][k]);
90 }
91 int get_lcp(int i, int j) { // lcp of suffix starting from i and j
92 if (i == j) return n - i;
93 int l = rank[i], r = rank[j];
94 if (l > r) swap(l, r);
95 return query(l, r - 1);
96 }
97};
98struct IsomorphicSuffixArray {
99 string s;

Callers 2

IsomorphicSuffixArrayMethod · 0.45
get_lcp_bruteMethod · 0.45

Calls 1

queryFunction · 0.50

Tested by

no test coverage detected