We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d02353 commit de14762Copy full SHA for de14762
1 file changed
Collection/src/Graphs/rep.java
@@ -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
39
40
41
42
+}
43
0 commit comments