Update Main.java
This commit is contained in:
parent
e3b6d583b2
commit
8463875b6a
1 changed files with 5 additions and 1 deletions
|
|
@ -13,8 +13,12 @@ public class Main
|
||||||
*/
|
*/
|
||||||
Tree tree = new Tree(Integer.parseInt(args[0]), new ArrayList<Long>());
|
Tree tree = new Tree(Integer.parseInt(args[0]), new ArrayList<Long>());
|
||||||
for (int i = 0; i < Integer.parseInt(args[1]); i++) {
|
for (int i = 0; i < Integer.parseInt(args[1]); i++) {
|
||||||
|
/* Optimied the output */
|
||||||
|
int temp = tree.longestPath().size();
|
||||||
tree.step();
|
tree.step();
|
||||||
Util.printList(tree.longestPath());
|
if(tree.longestPath().size() != temp){
|
||||||
|
Util.printList(tree.longestPath());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue