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

Class node

code/graph/lca.cpp:1–9  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1struct node {
2 node *p, *jmp[20];
3 int depth;
4 node(node *_p = NULL) : p(_p) {
5 depth = p ? 1 + p->depth : 0;
6 memset(jmp, 0, sizeof(jmp));
7 jmp[0] = p;
8 for (int i = 1; (1<<i) <= depth; i++)
9 jmp[i] = jmp[i-1]->jmp[i-1]; } };
10node* st[100000];
11node* lca(node *a, node *b) {
12 if (!a || !b) return NULL;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected