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

Function find

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

Source from the content-addressed store, hash-verified

21 l->r = merge(l->r, r); augment(l); return l; }
22 r->l = merge(l, r->l); augment(r); return r; }
23node* find(node *t, int x) {
24 while (t) {
25 if (x < t->x) t = t->l;
26 else if (t->x < x) t = t->r;
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);

Callers 5

eraseMethod · 0.85
findMethod · 0.85
uniteMethod · 0.85
sizeMethod · 0.85
insertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected