forked from IvanLu1024/Java-Notes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
30 lines (24 loc) · 639 Bytes
/
Main.java
File metadata and controls
30 lines (24 loc) · 639 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package code_13_graph;
/**
* Created by 18351 on 2019/1/6.
*/
public class Main {
public static void main(String[] args) {
DenseGraph g1=new DenseGraph(4,false);
g1.addEdge(0,1);
g1.addEdge(0,2);
g1.addEdge(0,3);
g1.addEdge(1,3);
g1.addEdge(2,3);
Iterable<Integer> adj1=g1.adj(0);
System.out.println(adj1);
DenseGraph g2=new DenseGraph(4,false);
g2.addEdge(0,1);
g2.addEdge(0,2);
g2.addEdge(0,3);
g2.addEdge(1,3);
g2.addEdge(2,3);
Iterable<Integer> adj2=g1.adj(0);
System.out.println(adj2);
}
}