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

Method update

code/data-structures/segment_tree.cpp:13–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11 l == r ? node(l,r,a[l]) :
12 node(mk(a,2*i+1,l,m),mk(a,2*i+2,m+1,r)); }
13 node update(int at, ll v, int i=0) {
14 propagate(i);
15 int hl = arr[i].l, hr = arr[i].r;
16 if (at < hl || hr < at) return arr[i];
17 if (hl == at && at == hr) {
18 arr[i].update(v); return arr[i]; }
19 return arr[i] =
20 node(update(at,v,2*i+1),update(at,v,2*i+2)); }
21 node query(int l, int r, int i=0) {
22 propagate(i);
23 int hl = arr[i].l, hr = arr[i].r;

Callers

nothing calls this directly

Calls 2

updateFunction · 0.85
nodeClass · 0.70

Tested by

no test coverage detected