东航logo a4纸:加急!!大家快来看看!!我的数据结构作业(java描述),运行不出结果,大家帮改改吧,谢谢了(2)

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/29 14:51:01
class dfsAPP
{
public static void main(String[] args)
{
Graph theGraph=new Graph();
theGraph.addperson(0,0301);
theGraph.addperson(1,0302);
theGraph.addperson(2,0303);
theGraph.addperson(3,0304);
theGraph.addperson(4,0305);

theGraph.addedge(0,0301,1,0302);
theGraph.addedge(1,0302,2,0303);
theGraph.addedge(0,0301,3,0304);
theGraph.addedge(2,0303,4,0305);

System.out.print("visits:");
theGraph.dfs();
System.out.println();
}//end main()
}

class dfsAPP
{
public static void main(String[] args)
{
Graph theGraph=new Graph();
theGraph.addperson(0,0301);
theGraph.addperson(1,0302);
theGraph.addperson(2,0303);
theGraph.addperson(3,0304);
theGraph.addperson(4,0305);

theGraph.addedge(0,0301,1,0302);
theGraph.addedge(1,0302,2,0303);
theGraph.addedge(0,0301,3,0304);
theGraph.addedge(2,0303,4,0305);

System.out.print("visits:");
theGraph.dfs();
System.out.println();
}
}