Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitba7dbba

Browse files
add tests for 814
1 parent09b1b99 commitba7dbba

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
returnroot;
2020
}
2121
}
22+
2223
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
packagecom.fishercoder;
2+
3+
importcom.fishercoder.common.classes.TreeNode;
4+
importcom.fishercoder.common.utils.TreeUtils;
5+
importcom.fishercoder.solutions._814;
6+
importorg.junit.BeforeClass;
7+
importorg.junit.Test;
8+
9+
importjava.util.Arrays;
10+
11+
publicclass_814Test {
12+
privatestatic_814.Solution1solution1;
13+
14+
@BeforeClass
15+
publicstaticvoidsetup() {
16+
solution1 =new_814.Solution1();
17+
}
18+
19+
@Test
20+
publicvoidtest1() {
21+
TreeUtils.printBinaryTree(solution1.pruneTree(TreeUtils.constructBinaryTree(Arrays.asList(1,null,0,0,1))));
22+
}
23+
24+
@Test
25+
publicvoidtest2() {
26+
TreeNoderoot =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)

[8]ページ先頭

©2009-2025 Movatter.jp