-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInvertBinaryTreeTest.java
More file actions
38 lines (37 loc) · 985 Bytes
/
Copy pathInvertBinaryTreeTest.java
File metadata and controls
38 lines (37 loc) · 985 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
38
import org.example.helpers.TreeNode;
import org.example.problems.invert_binary_tree.Solution;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class InvertBinaryTreeTest {
@Test
public void test() {
TreeNode tree = new TreeNode(
4,
new TreeNode(
2,
new TreeNode(1),
new TreeNode(3)
),
new TreeNode(
7,
new TreeNode(6),
new TreeNode(9)
)
);
TreeNode expected = new TreeNode(
4,
new TreeNode(
7,
new TreeNode(9),
new TreeNode(6)
),
new TreeNode(
2,
new TreeNode(3),
new TreeNode(1)
)
);
Solution s = new Solution();
Assertions.assertTrue(s.invertTree(tree).equals(expected));
}
}