首页 > 代码库 > Graph

Graph

public class Graph{

  public void dfs(Vertex u)

  {

    u.visit();

    u.visited = true;

    for(each v such that (u,v) belongs E)

    {

      if(!v.visited){

        dfs(v);

      }

    }

  }

}

Graph