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

Method count_less

code/data-structures/avl_tree.cpp:111–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109 else break;
110 } return cur; }
111 int count_less(node *cur) {
112 int sum = sz(cur->l);
113 while (cur) {
114 if (cur->p && cur->p->r == cur) sum += 1 + sz(cur->p->l);
115 cur = cur->p;
116 } return sum; }
117 void clear() { delete_tree(root), root = NULL; } };
118// vim: cc=60 ts=2 sts=2 sw=2:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected