Пример #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);
 }