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

Method get_lcp

Strings/Suffix Array.cpp:140–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138 return min(t[l][k], t[r - (1 << k) + 1][k]);
139 }
140 int get_lcp(int i, int j) { // lcp of suffix starting from i and j
141 if (i == j) return n - i;
142 int l = rank[i], r = rank[j];
143 if (l > r) swap(l, r);
144 return query(l, r - 1);
145 }
146 int lower_bound(string &t) {
147 int l = 0, r = n - 1, k = t.size(), ans = n;
148 while (l <= r) {

Callers

nothing calls this directly

Calls 1

queryFunction · 0.50

Tested by

no test coverage detected