We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66c6353 commit 57fbbcdCopy full SHA for 57fbbcd
1 file changed
Others/Dijkstra.java
@@ -57,7 +57,7 @@ public Edge(String v1, String v2, int dist) {
57
}
58
59
/** One vertex of the graph, complete with mappings to neighbouring vertices */
60
- public static class Vertex implements Comparable<Vertex>{
+ public static class Vertex implements Comparable<Vertex> {
61
public final String name;
62
public int dist = Integer.MAX_VALUE; // MAX_VALUE assumed to be infinity
63
public Vertex previous = null;
@@ -67,7 +67,7 @@ public Vertex(String name){
67
this.name = name;
68
69
70
- private void printPath(){
+ private void printPath() {
71
if (this == this.previous)
72
{
73
System.out.printf("%s", this.name);
@@ -83,14 +83,14 @@ else if (this.previous == null)
83
84
85
86
- public int compareTo(Vertex other){
+ public int compareTo(Vertex other) {
87
if (dist == other.dist)
88
return name.compareTo(other.name);
89
90
return Integer.compare(dist, other.dist);
91
92
93
- @Override public String toString(){
+ @Override public String toString() {
94
return "(" + name + ", " + dist + ")";
95
96
0 commit comments