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

Function findTopoSortDFS2

CPP/graphseries.cpp:266–277  ·  view source on GitHub ↗

This function is customized for the "shortestPathDAG" fuction

Source from the content-addressed store, hash-verified

264
265// This function is customized for the "shortestPathDAG" fuction
266void findTopoSortDFS2(int node, vector<pair<int, int>> arr[], stack<int> &s, vector<int> &vis)
267{
268 vis[node] = 1;
269 for (auto i : arr[node])
270 {
271 if (!vis[i])
272 {
273 findTopoSortDFS2(i.first, arr, s, vis);
274 }
275 }
276 s.push(node);
277}
278
279// shortest path in weighted DAG(Directed Acyclic Graph)
280void shortestPathDAG(vector<pair<int, int>> arr[], int n, int source)

Callers 1

shortestPathDAGFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected