Skip to content
Snippets Groups Projects
Commit 76a4e529 authored by Lawrence Chung's avatar Lawrence Chung
Browse files

Added test cases CC.java

parent 2ff9d6c9
No related branches found
No related tags found
No related merge requests found
......@@ -7,13 +7,16 @@ public class CC {
private int count;
public static void main(String[] args) {
Graph g = new Graph(5);
Graph g = new Graph(6);
g.addEdge(4, 3);
g.addEdge(2, 3);
g.addEdge(1, 2);
g.addEdge(0, 2);
CC component = new CC(g);
System.out.println(component.connected(0, 2));
System.out.println(component.connected(2, 0));
System.out.println(component.connected(0,1));
System.out.println(component.connected(1, 5));
System.out.println(component.connected(1,6)); //throws exception (supposed to)
}
public CC(Graph G){
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment