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

Function test_1

code/graph/scc.test.cpp:1–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1void test_1() {
2 vvi adj(4);
3
4 adj[0].push_back(1);
5 adj[1].push_back(0);
6 adj[1].push_back(2);
7 adj[2].push_back(3);
8 adj[3].push_back(2);
9
10 pair<union_find, vi> res = scc(adj);
11 union_find scc = res.first;
12 vi dag = res.second;
13
14 assert_equal(scc.find(0), scc.find(1));
15 assert_equal(scc.find(2), scc.find(3));
16 assert_not_equal(scc.find(0), scc.find(2));
17
18 assert_equal(scc.find(2), scc.find(dag[0]));
19 assert_equal(scc.find(0), scc.find(dag[1]));
20}
21
22void test_2() {
23 vvi adj(2);

Callers 1

testFunction · 0.70

Calls 5

sccFunction · 0.85
assert_not_equalFunction · 0.85
push_backMethod · 0.80
assert_equalFunction · 0.50
findMethod · 0.45

Tested by

no test coverage detected