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

Function dfs

graph/code5.cpp:13–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11}
12
13void dfs(vector<int> vec[], int source, vector<bool> &visited)
14{
15 visited[source] = true;
16 cout << source << " ";
17 for (int i = 0; i < vec[source].size(); i++)
18 {
19 int adjacent = vec[source][i];
20 if (visited[adjacent] == false)
21 {
22 dfs(vec, adjacent, visited);
23 }
24 }
25}
26
27void dfs_rec(vector<int> vec[], int v)
28{

Callers 1

dfs_recFunction · 0.70

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected