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

Function insert

code/data-structures/cartesian_tree.cpp:29–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 else return t; }
28 return NULL; }
29node* insert(node *t, int x, int y) {
30 if (find(t, x) != NULL) return t;
31 pair<node*,node*> res = split(t, x);
32 return merge(res.first,
33 merge(new node(x, y), res.second)); }
34node* erase(node *t, int x) {
35 if (!t) return NULL;
36 if (t->x < x) t->r = erase(t->r, x);

Callers 1

insert_lineMethod · 0.70

Calls 3

findFunction · 0.85
mergeFunction · 0.85
splitFunction · 0.70

Tested by

no test coverage detected