forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_102Test.java
More file actions
35 lines (28 loc) · 975 Bytes
/
_102Test.java
File metadata and controls
35 lines (28 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.fishercoder;
import com.fishercoder.common.classes.TreeNode;
import com.fishercoder.common.utils.CommonUtils;
import com.fishercoder.common.utils.TreeUtils;
import com.fishercoder.solutions._102;
import org.junit.BeforeClass;
import org.junit.Test;
import java.util.Arrays;
public class _102Test {
private static _102.Solution1 solution1;
private static TreeNode treeRoot;
@BeforeClass
public static void setup() {
solution1 = new _102.Solution1();
}
@Test
public void test1() {
treeRoot = TreeUtils.constructBinaryTree(Arrays.asList(1, 2, 3));
TreeUtils.printBinaryTree(treeRoot);
CommonUtils.printListList(solution1.levelOrder(treeRoot));
}
@Test
public void test2() {
treeRoot = TreeUtils.constructBinaryTree(Arrays.asList(3, 9, 20, null, null, 15, 7));
TreeUtils.printBinaryTree(treeRoot);
CommonUtils.printListList(solution1.levelOrder(treeRoot));
}
}