8000 update _144 · aav789/Leetcode@aac8d0b · GitHub
[go: up one dir, main page]

Skip to content

Commit aac8d0b

Browse files
update _144
1 parent 35d24a8 commit aac8d0b

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/main/java/com/fishercoder/solutions/_144.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ public List<Integer> preorderTraversal(TreeNode root) {
2828

2929
public static class Solution2 {
3030
public List<Integer> preorderTraversal(TreeNode root) {
31-
List<Integer> list = new ArrayList();
32-
return pre(root, list);
31+
return pre(root, new ArrayList());
3332
}
3433

3534
List<Integer> pre(TreeNode root, List<Integer> list) {

src/test/java/com/fishercoder/_144Test.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
import com.fishercoder.common.classes.TreeNode;
44
import com.fishercoder.common.utils.TreeUtils;
55
import com.fishercoder.solutions._144;
6-
import org.junit.BeforeClass;
7-
import org.junit.Test;
6+
import org.junit.jupiter.api.BeforeEach;
7+
import org.junit.jupiter.api.Test;
88

99
import java.util.Arrays;
1010
import java.util.List;
1111

12-
import static org.junit.Assert.assertEquals;
12+
import static org.junit.jupiter.api.Assertions.assertEquals;
1313

1414
public class _144Test {
1515
private static _144.Solution1 solution1;
@@ -18,8 +18,8 @@ public class _144Test {
1818
private static TreeNode root;
1919
private static List<Integer> inorder;
2020

21-
@BeforeClass
22-
public static void setup() {
21+
@BeforeEach
22+
public void setup() {
2323
solution1 = new _144.Solution1();
2424
solution2 = new _144.Solution2();
2525
solution3 = new _144.Solution3();

0 commit comments

Comments
 (0)
0