diff --git a/Others/Dijkstra.java b/Others/Dijkstra.java index 0fe461348..b3df65bfd 100644 --- a/Others/Dijkstra.java +++ b/Others/Dijkstra.java @@ -68,16 +68,13 @@ class Graph { } private void printPath() { - if (this == this.previous) - { + if (this == this.previous) { System.out.printf("%s", this.name); } - else if (this.previous == null) - { + else if (this.previous == null) { System.out.printf("%s(unreached)", this.name); } - else - { + else { this.previous.printPath(); System.out.printf(" -> %s(%d)", this.name, this.dist); }