use of com.fishercoder.common.classes.TreeNode in project Leetcode by fishercoder1534.
the class _513Test method test2.
@Test
public void test2() {
TreeNode root = new TreeNode(1);
root.left = new TreeNode(2);
root.right = new TreeNode(3);
root.left.left = new TreeNode(4);
root.right.left = new TreeNode(5);
root.right.right = new TreeNode(6);
root.right.left.left = new TreeNode(7);
expected = 7;
actual = test.findBottomLeftValue(root);
assertEquals(expected, actual);
}
use of com.fishercoder.common.classes.TreeNode in project Leetcode by fishercoder1534.
the class _530Test method test3.
// [543,384,652,null,445,null,699]
@Test
public void test3() {
root = new TreeNode(543);
root.left = new TreeNode(384);
root.right = new TreeNode(652);
root.left.right = new TreeNode(445);
root.right.right = new TreeNode(699);
expected = 47;
actual = test.getMinimumDifference(root);
assertEquals(expected, actual);
}
use of com.fishercoder.common.classes.TreeNode in project Leetcode by fishercoder1534.
the class _530Test method test2.
@Test
public void test2() {
root = new TreeNode(1);
root.right = new TreeNode(5);
root.right.left = new TreeNode(3);
expected = 2;
actual = test.getMinimumDifference(root);
assertEquals(expected, actual);
}
use of com.fishercoder.common.classes.TreeNode in project Leetcode by fishercoder1534.
the class _530Test method test1.
@Test
public void test1() {
root = new TreeNode(1);
root.right = new TreeNode(3);
root.right.left = new TreeNode(2);
expected = 1;
actual = test.getMinimumDifference(root);
assertEquals(expected, actual);
}
use of com.fishercoder.common.classes.TreeNode in project Leetcode by fishercoder1534.
the class _563Test method test2.
@Ignore
@Test
public void test2() {
root = new TreeNode(1);
root.left = new TreeNode(2);
root.right = new TreeNode(3);
root.left.left = new TreeNode(4);
root.right.left = new TreeNode(5);
expected = 11;
actual = test.findTilt(root);
assertEquals(expected, actual);
}
Aggregations