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

Method build

Data Structures/Segment Tree.cpp:13–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11 memset(t, 0, sizeof t);
12 }
13 void build(int n, int b, int e) {
14 if (b == e) {
15 t[n] = a[b];
16 return;
17 }
18 int mid = (b + e) >> 1, l = n << 1, r = l | 1;
19 build(l, b, mid);
20 build(r, mid + 1, e);
21 t[n] = max(t[l], t[r]);
22 }
23 void upd(int n, int b, int e, int i, int x) {
24 if (b > i || e < i) return;
25 if (b == e && b == i) {

Callers

nothing calls this directly

Calls 1

buildFunction · 0.70

Tested by

no test coverage detected