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

Function dfs

graph/code18.cpp:57–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57void dfs(vector<int> transpose[], int source, vector<bool> &visited)
58{
59 cout << source << " ";
60 visited[source] = true;
61 for (int i = 0; i < transpose[source].size(); i++)
62 {
63 int adjacent = transpose[source][i];
64 if (visited[adjacent] == false)
65 {
66 dfs(transpose, adjacent, visited);
67 }
68 }
69}
70
71void kosaraju(vector<int> vec[], int v, vector<int> transpose[])
72{

Callers 1

kosarajuFunction · 0.70

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected