File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
main/java/com/fishercoder/solutions
test/java/com/fishercoder Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,7 @@ public List<Integer> preorderTraversal(TreeNode root) {
28
28
29
29
public static class Solution2 {
30
30
public List <Integer > preorderTraversal (TreeNode root ) {
31
- List <Integer > list = new ArrayList ();
32
- return pre (root , list );
31
+ return pre (root , new ArrayList ());
33
32
}
34
33
35
34
List <Integer > pre (TreeNode root , List <Integer > list ) {
Original file line number Diff line number Diff line change 3
3
import com .fishercoder .common .classes .TreeNode ;
4
4
import com .fishercoder .common .utils .TreeUtils ;
5
5
import com .fishercoder .solutions ._144
8000
span>;
6
- import org .junit .BeforeClass ;
7
- import org .junit .Test ;
6
+ import org .junit .jupiter . api . BeforeEach ;
7
+ import org .junit .jupiter . api . Test ;
8
8
9
9
import java .util .Arrays ;
10
10
import java .util .List ;
11
11
12
- import static org .junit .Assert .assertEquals ;
12
+ import static org .junit .jupiter . api . Assertions .assertEquals ;
13
13
14
14
public class _144Test {
15
15
private static _144 .Solution1 solution1 ;
@@ -18,8 +18,8 @@ public class _144Test {
18
18
private static TreeNode root ;
19
19
private static List <Integer > inorder ;
20
20
21
- @ BeforeClass
22
- public static void setup () {
21
+ @ BeforeEach
22
+ public void setup () {
23
23
solution1 = new _144 .Solution1 ();
24
24
solution2 = new _144 .Solution2 ();
25
25
solution3 = new _144 .Solution3 ();
You can’t perform that action at this time.
0 commit comments