-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
35 lines (29 loc) · 748 Bytes
/
Main.java
File metadata and controls
35 lines (29 loc) · 748 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
31
32
33
34
35
package com.company;
public class Main {
public void addEdge(int u, int v){
DLL obj = new DLL();
Node tm = obj.check(u);
System.out.println("I am tm: "+tm);
if (tm != null){
System.out.println("I am tm: "+tm);
while(tm.next!=null){
tm = tm.next;
}
tm.next = new Node(v);
}
else{
obj.addVertex(u);
}
}
public static void main(String[] args) {
DLL obj = new DLL();
Main m = new Main();
obj.addVertex(0);
obj.addVertex(1);
obj.addVertex(2);
obj.addVertex(3);
//m.addEdge(0,1);
m.addEdge(1,3);
obj.display();
}
}