Skip to content

Commit

Permalink
Add steps in short for kosaraju's Algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
nandwalritik authored Jul 17, 2021
1 parent d96321f commit 2f7b684
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion graph/kosaraju.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#include<bits/stdc++.h>
using namespace std;
/*
Method
1.) Find topological sort
2.) Find the Transpose of Graph
3.) Perform dfs on transposed graph to find the component
*/
void dfs1(vector<int> &order,vector<bool> &visited,vector<vector<int>> &adj,int u){
visited[u] = true;
for(auto x:adj[u])
Expand Down Expand Up @@ -54,4 +60,4 @@ int main(){


return 0;
}
}

0 comments on commit 2f7b684

Please sign in to comment.