예제 #1
0
 @Test
 public void tree_ins_2_04() {
   int[] keys = {0, 9, 2, 7, 4, 5, 6, 3, 8, 1};
   RangeIndex rIndex = makeRangeIndex(2);
   testInsert(rIndex, keys);
   assertEquals(0, r(rIndex.minKey()));
   assertEquals(9, r(rIndex.maxKey()));
 }
예제 #2
0
 @Test
 public void tree_ins_2_02() {
   int[] keys = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
   RangeIndex rIndex = makeRangeIndex(2);
   testInsert(rIndex, keys);
   assertEquals(0, r(rIndex.minKey()));
   assertEquals(9, r(rIndex.maxKey()));
 }
예제 #3
0
 @Test
 public void tree_ins_0_1() {
   int[] keys = {0, 1, 2};
   RangeIndex rIndex = makeRangeIndex(2);
   testInsert(rIndex, keys);
   assertFalse(rIndex.isEmpty());
   assertEquals(0, r(rIndex.minKey()));
   assertEquals(2, r(rIndex.maxKey()));
 }
예제 #4
0
 @Test
 public void tree_ins_0_0() {
   // Empty tree
   int[] keys = {};
   RangeIndex rIndex = makeRangeIndex(2);
   testInsert(rIndex, keys);
   assertTrue(rIndex.isEmpty());
   assertNull(rIndex.minKey());
   assertNull(rIndex.maxKey());
 }
예제 #5
0
 @Test
 public void tree_ins_2_05() {
   int[] keys = {0, 18, 4, 14, 8, 10, 12, 6, 16, 2};
   RangeIndex rIndex = makeRangeIndex(2);
   testInsert(rIndex, keys);
   assertFalse(rIndex.contains(r(1)));
   assertFalse(rIndex.contains(r(999)));
   assertFalse(rIndex.contains(r(-9)));
   assertFalse(rIndex.contains(r(7)));
   assertEquals(0, r(rIndex.minKey()));
   assertEquals(18, r(rIndex.maxKey()));
 }