graph.java

来自「java的DFS(Depth-first search )和BFS(Breadt」· Java 代码 · 共 18 行

JAVA
18
字号
interface Graph									//Graph class ADT
{
	public int n();								//Number of vertices
	public int e();								//Number of edges
	public Edge first(int v);					//Get first edge for vertex
	public Edge next(Edge w);					//Get next edge for vertex
	public boolean isEdge(Edge w);				//True if this is an edge
	public boolean isEdge(int i, int j);		//True if this is an edge
	public int v1(Edge w);						//Where edge came from
	public int v2(Edge w);						//Where edge goes to
	public void setEdge(int i, int j);			//Set edges
	//we don't use delEdge methods this lab, but you should finish it after lab
	public void delEdge(int i, int j);			//Delete edge(i, j)
	public void delEdge(Edge w);				//Delete edge w
	public void setMark(int v, int val);		//Set Mark for v
	public int getMark (int v);					//Get Mark for v
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?