diff options
| author | Gloria Mundi <gloria@gloria-mundi.eu> | 2024-11-16 01:24:14 +0100 |
|---|---|---|
| committer | Gloria Mundi <gloria@gloria-mundi.eu> | 2024-11-16 01:24:14 +0100 |
| commit | 98567ec798aa8ca2cfbcb85c774dd470f30e30d4 (patch) | |
| tree | 5113d5cc24d1ad5f93810b6442ce584a36950dc8 /graph/euler.cpp | |
| parent | ad3856a6b766087df0036de0b556f4700a6498c9 (diff) | |
| parent | 8d11c6c8213f46f0fa19826917c255edd5d43cb1 (diff) | |
mzuenni tests
Diffstat (limited to 'graph/euler.cpp')
| -rw-r--r-- | graph/euler.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/graph/euler.cpp b/graph/euler.cpp deleted file mode 100644 index a5ea192..0000000 --- a/graph/euler.cpp +++ /dev/null @@ -1,23 +0,0 @@ -vector<vector<int>> idx; -vector<int> to, validIdx, cycle; -vector<bool> used; - -void addEdge(int u, int v) { - idx[u].push_back(sz(to)); - to.push_back(v); - used.push_back(false); - idx[v].push_back(sz(to)); // für ungerichtet - to.push_back(u); - used.push_back(false); -} - -void euler(int v) { // init idx und validIdx - for (;validIdx[v] < sz(idx[v]); validIdx[v]++) { - if (!used[idx[v][validIdx[v]]]) { - int u = to[idx[v][validIdx[v]]]; - used[idx[v][validIdx[v]]] = true; - used[idx[v][validIdx[v]] ^ 1] = true; // für ungerichtet - euler(u); - }} - cycle.push_back(v); // Zyklus in umgekehrter Reihenfolge. -} |
