File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,13 +63,11 @@ public static class Vertex implements Comparable<Vertex>{
6363 public Vertex previous = null ;
6464 public final Map <Vertex , Integer > neighbours = new HashMap <>();
6565
66- public Vertex (String name )
67- {
66+ public Vertex (String name ){
6867 this .name = name ;
6968 }
7069
71- private void printPath ()
72- {
70+ private void printPath (){
7371 if (this == this .previous )
7472 {
7573 System .out .printf ("%s" , this .name );
@@ -85,16 +83,14 @@ else if (this.previous == null)
8583 }
8684 }
8785
88- public int compareTo (Vertex other )
89- {
86+ public int compareTo (Vertex other ){
9087 if (dist == other .dist )
9188 return name .compareTo (other .name );
9289
9390 return Integer .compare (dist , other .dist );
9491 }
9592
96- @ Override public String toString ()
97- {
93+ @ Override public String toString (){
9894 return "(" + name + ", " + dist + ")" ;
9995 }
10096}
@@ -175,4 +171,4 @@ public void printAllPaths() {
175171 System .out .println ();
176172 }
177173 }
178- }
174+ }
You can’t perform that action at this time.
0 commit comments