Skip to content

Commit ba7dbba

Browse files
add tests for 814
1 parent 09b1b99 commit ba7dbba

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ public TreeNode pruneTree(TreeNode root) {
1919
return root;
2020
}
2121
}
22+
2223
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.fishercoder;
2+
3+
import com.fishercoder.common.classes.TreeNode;
4+
import com.fishercoder.common.utils.TreeUtils;
5+
import com.fishercoder.solutions._814;
6+
import org.junit.BeforeClass;
7+
import org.junit.Test;
8+
9+
import java.util.Arrays;
10+
11+
public class _814Test {
12+
private static _814.Solution1 solution1;
13+
14+
@BeforeClass
15+
public static void setup() {
16+
solution1 = new _814.Solution1();
17+
}
18+
19+
@Test
20+
public void test1() {
21+
TreeUtils.printBinaryTree(solution1.pruneTree(TreeUtils.constructBinaryTree(Arrays.asList(1, null, 0, 0, 1))));
22+
}
23+
24+
@Test
25+
public void test2() {
26+
TreeNode root = TreeUtils.constructBinaryTree(Arrays.asList(1, 0, 1, 0, 0, 0, 1));
27+
TreeUtils.printBinaryTree(root);
28+
TreeUtils.printBinaryTree(solution1.pruneTree(root));
29+
}
30+
31+
}

0 commit comments

Comments
 (0)