use of com.fishercoder.common.classes.TreeNode in project Leetcode by fishercoder1534.
the class _449Test method test1.
@Test
public void test1() {
expectedRoot = new TreeNode(3);
expectedRoot.left = new TreeNode(1);
expectedRoot.right = new TreeNode(4);
expectedRoot.left.right = new TreeNode(2);
assertEquals(expectedRoot.toString(), solution1.deserialize(solution1.serialize(expectedRoot)).toString());
assertEquals(expectedRoot.toString(), solution2.deserialize(solution2.serialize(expectedRoot)).toString());
assertEquals(expectedRoot.toString(), solution3.deserialize(solution3.serialize(expectedRoot)).toString());
}
use of com.fishercoder.common.classes.TreeNode in project Leetcode by fishercoder1534.
the class _449Test method test2.
@Test
public void test2() {
expectedRoot = new TreeNode(2);
expectedRoot.left = new TreeNode(1);
expectedRoot.right = new TreeNode(3);
assertEquals(expectedRoot.toString(), solution1.deserialize(solution1.serialize(expectedRoot)).toString());
assertEquals(expectedRoot.toString(), solution2.deserialize(solution2.serialize(expectedRoot)).toString());
assertEquals(expectedRoot.toString(), solution3.deserialize(solution3.serialize(expectedRoot)).toString());
}
use of com.fishercoder.common.classes.TreeNode in project Leetcode by fishercoder1534.
the class _501Test method setupForEachTest.
@Before
public void setupForEachTest() {
expected = new int[] {};
actual = new int[] {};
treeNode = new TreeNode(0);
}
use of com.fishercoder.common.classes.TreeNode in project Leetcode by fishercoder1534.
the class _513Test method setupForEachTest.
@Before
public void setupForEachTest() {
expected = 0;
actual = 0;
root = new TreeNode(0);
}
use of com.fishercoder.common.classes.TreeNode in project Leetcode by fishercoder1534.
the class _513Test method test1.
@Test
public void test1() {
TreeNode root = new TreeNode(2);
root.left = new TreeNode(1);
root.right = new TreeNode(3);
expected = 1;
actual = test.findBottomLeftValue(root);
assertEquals(expected, actual);
}
Aggregations