Skip to content

Commit de14762

Browse files
initial commit
1 parent 9d02353 commit de14762

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

Collection/src/Graphs/rep.java

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
*
3+
*/
4+
package Graphs;
5+
import java.util.*;
6+
/**
7+
* @author M.NAVEEN
8+
* RANDOM CODER'S
9+
* Tech/Project Lead Android Club
10+
*/
11+
public class rep
12+
{
13+
14+
static ArrayList<ArrayList<Integer>> graph=new ArrayList<ArrayList<Integer>>();
15+
16+
public static void main(String ...strings)
17+
{
18+
for(int i=0;i<5;i++)
19+
{
20+
graph.add(new ArrayList<Integer>()); //allocates the memeory
21+
}
22+
23+
System.out.println(graph);
24+
graph.get(0).add(1);
25+
graph.get(0).add(4);
26+
graph.get(1).add(3);
27+
graph.get(1).add(4);
28+
graph.get(1).add(0);
29+
graph.get(2).add(1);
30+
graph.get(2).add(3);
31+
graph.get(3).add(1);
32+
graph.get(3).add(4);
33+
graph.get(4).add(3);
34+
graph.get(4).add(0);
35+
36+
37+
38+
System.out.println(graph);
39+
}
40+
41+
42+
}
43+

0 commit comments

Comments
 (0)