indresh149's blog

By indresh149, history, 15 months ago, In English

Again there is a clash between codeforces and codechef contest on 1st feb. Which one do you attempt

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By indresh149, history, 2 years ago, In English

void dfs(int node, vector &vis, vector adj[], vector &storeDfs) { storeDfs.push_back(node); vis[node] = 1; for(auto it : adj[node]) { if(!vis[it]) { dfs(it, vis, adj, storeDfs); } } }

public: // Function to return a list containing the DFS traversal of the graph. vector dfsOfGraph(int V, vector adj[]) { // Code here vector storeDfs; vector vis(V+1, 0); for(int i = 1;i<=V;i++) { if(!vis[i]) dfs(i, vis, adj, storeDfs); } return storeDfs; } };

What is the error giving segmentation fault?

Full text and comments »

Tags dfs
  • Vote: I like it
  • 0
  • Vote: I do not like it