Skip to content

Commit 02c4ebd

Browse files
authored
Update Vertex.java
1 parent d12e5d1 commit 02c4ebd

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

Data Structures/Vertex.java

+8-16
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1+
static class Vertex{
2+
public int name;
3+
public int distance;
14

2-
public class Vertex {
3-
4-
//Vertex class
5-
//probably unnecessary, but already built into Prim's Algorith implementation
6-
7-
int value;
8-
9-
public Vertex(int val){
10-
value=val;
5+
public Vertex(int name, int distance){
6+
this.name = name;
7+
this.distance = distance;
118
}
12-
13-
public int getValue(){
14-
return value;
15-
}
16-
9+
1710
public String toString(){
18-
return String.valueOf(value);
11+
return "Name: "+name+", Weight: "+distance;
1912
}
20-
2113
}

0 commit comments

Comments
 (0)