示例#1
0
 @Test
 public void isBST() {
   assertTrue(TreeUtilsTest.isBST(TreeUtils.createBSTFromRange(0, 9)));
   assertTrue(TreeUtilsTest.isBST(TreeUtils.createBSTFromRange(5, 9)));
   assertTrue(TreeUtilsTest.isBST(TreeUtils.createBSTFromRange(0, 2)));
 }
示例#2
0
 @Test
 public void startEqualsEnd() {
   Node<Integer> aux = TreeUtils.createBSTFromRange(5, 5);
   assertTrue(TreeUtilsTest.rootWithNoChild(aux));
 }
示例#3
0
 @Test
 public void startBiggerThanEnd() {
   assertEquals(TreeUtils.createBSTFromRange(5, 4), null);
 }