Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- map <string, vector<string>> myMap;
- set <string> mySet;
- stack <string> topo;
- void dfs(string u){
- mySet.insert(u);
- for(string v: g){
- if(mySet.find(u) == mySet.end()){
- dfs(v);
- }
- }
- topo.push(u);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement