MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / dfs

Function dfs

CPP/graphseries.cpp:73–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void dfs(int node, vector<int> &vis, vector<int> arr[], vector<int> &ans)
74{
75 vis[node] = 1;
76 ans.push_back(node);
77 for (auto i : arr[node])
78 {
79 if (!vis[i])
80 {
81 vis[i] = 1;
82 dfs(i, vis, arr, ans);
83 }
84 }
85}
86
87bool bipertiteBFS(int n, vector<int> &color, vector<int> arr[])
88{

Callers

nothing calls this directly

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected