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

Method add_edge

code/graph/hld.test.cpp:10–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8 HLD_naive(int _n) : n(_n), adj(n), parent(n, ii(-1, ID)) { }
9
10 void add_edge(int u, int v) {
11 adj[u].push_back(ii(v, ID));
12 adj[v].push_back(ii(u, ID));
13 parent[v] = ii(u, ID);
14 }
15
16 void update_cost(int u, int v, int c) {
17 if (parent[v].first == u)

Callers 1

testFunction · 0.45

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected