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

Method split

Data Structures/Segment Tree 2D Dynamic.cpp:31–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 root = nullptr;
30 }
31 void split(node *t, int pos, node *&l, node *&r) {
32 if (t == nullptr) {
33 l = r = nullptr;
34 return;
35 }
36 if (t->pos < pos) {
37 split(t->r, pos, l, r);
38 t->r = l;
39 l = t;
40 } else {
41 split(t->l, pos, l, r);
42 t->l = r;
43 r = t;
44 }
45 t->pull();
46 }
47 node* merge(node *l, node *r) {
48 if (!l || !r) return l ? l : r;
49 if (l->key < r->key) {

Callers

nothing calls this directly

Calls 2

splitFunction · 0.70
pullMethod · 0.45

Tested by

no test coverage detected