forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_104Test.java
More file actions
37 lines (29 loc) · 987 Bytes
/
_104Test.java
File metadata and controls
37 lines (29 loc) · 987 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
36
37
package com.fishercoder;
import com.fishercoder.common.classes.TreeNode;
import com.fishercoder.common.utils.TreeUtils;
import com.fishercoder.solutions._104;
import java.util.Arrays;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class _104Test {
private static _104.Solution1 solution1;
private static _104.Solution2 solution2;
private static TreeNode root;
@BeforeClass
public static void setup() {
solution1 = new _104.Solution1();
solution2 = new _104.Solution2();
}
@Test
public void test1() {
root = TreeUtils.constructBinaryTree(Arrays.asList(3, 9, 20, null, null, 15, 7));
assertEquals(3, solution1.maxDepth(root));
}
@Test
public void test2() {
root = TreeUtils.constructBinaryTree(Arrays.asList(3, 9, 20, null, null, 15, 7));
TreeUtils.printBinaryTree(root);
assertEquals(3, solution2.maxDepth(root));
}
}