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

Function topo_sort

graph/code18.cpp:30–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30void topo_sort(vector<int> vec[], int source, vector<bool> &visited, stack<int> &st)
31{
32 visited[source] = true;
33 for (int i = 0; i < vec[source].size(); i++)
34 {
35 int adjacent = vec[source][i];
36 if (visited[adjacent] == false)
37 {
38 topo_sort(vec, adjacent, visited, st);
39 }
40 }
41 st.push(source);
42}
43
44void find_transpose(vector<int> vec[], int v, vector<int> transpose[])
45{

Callers 1

kosarajuFunction · 0.70

Calls 2

sizeMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected