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

Method upd

Data Structures/Persistent UnionFind.cpp:39–42  ·  view source on GitHub ↗

update the ith value if the rth array by x and return the new root of the array

Source from the content-addressed store, hash-verified

37 }
38 // update the ith value if the rth array by x and return the new root of the array
39 int upd(int r, int i, T x) {
40 root.push_back(upd(root[r], i, x, 0, n - 1));
41 return root.size() - 1;
42 }
43 void set(int r, int i, T x) {
44 int k = upd(r, i, x);
45 root[r] = root[k];

Callers 1

mergeMethod · 0.45

Calls 3

push_backMethod · 0.80
updFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected