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

Method _ins

code/data-structures/kd_tree.cpp:61–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 return true; }
60 void insert(const pt &p) { _ins(p, root, 0); }
61 void _ins(const pt &p, node* &n, int c) {
62 if (!n) n = new node(p, NULL, NULL);
63 else if (cmp(c)(p, n->p)) _ins(p, n->l, INC(c));
64 else if (cmp(c)(n->p, p)) _ins(p, n->r, INC(c)); }
65 void clear() { _clr(root); root = NULL; }
66 void _clr(node *n) {
67 if (n) _clr(n->l), _clr(n->r), delete n; }

Callers

nothing calls this directly

Calls 1

cmpClass · 0.70

Tested by

no test coverage detected