implementing psuedocode into matlab??

0 votes
asked Apr 21, 2015 by clarkieg (2 points)
This code uses DFS to find cycles in a graph in matlab.  I am having trouble implementing it, adn would appreciate some help.

dfs(adj,node,visited)
  if (visited[node]);   
    if (node == start):  
      "found a path"  
    return;  
  visited[node]=YES;  
  for child in adj[node]:  
    dfs(adj,child,visited)
  visited[node]=NO;
Call the above function with the start node:

visited = {}
dfs(adj,start,visited)

Please log in or register to answer this question.

Related questions

0 votes
0 answers
asked Mar 26, 2016 by Deniz (2 points)
Welcome to Matlab Questions and Answers, where you can ask questions and receive answers from other members of the community.
...