摘要:
有向图 有向图就是边是有方向的图,例如: Digraph API java implementation 只是修改了 addEdge方法 addEdge(v,w) 增加了一条从v指向w 的边 public class Digraph { private final int V; private in 阅读全文
摘要:
无向图 我们用邻接图来表示图 具体实现的代码 public class Graph { private final int V; private int E; private Bag<Integer>[] adj; public Graph(int V){ this.V = V; E = 0; ad 阅读全文
摘要:
Percolation API public class Percolation { public Percolation(int n) // create n-by-n grid, with all sites blocked public void open(int row, int col) 阅读全文