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

Function euler_path

code/graph/euler_path.cpp:16–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14 if (start == -1) start = end = any;
15 return ii(start, end); }
16bool euler_path() {
17 ii se = start_end();
18 int cur = se.first, at = m + 1;
19 if (cur == -1) return false;
20 stack<int> s;
21 while (true) {
22 if (outdeg[cur] == 0) {
23 res[--at] = cur;
24 if (s.empty()) break;
25 cur = s.top(); s.pop();
26 } else s.push(cur), cur = adj[cur][--outdeg[cur]]; }
27 return at == 0; }
28// vim: cc=60 ts=2 sts=2 sw=2:

Callers

nothing calls this directly

Calls 5

start_endFunction · 0.85
emptyMethod · 0.45
topMethod · 0.45
popMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected