コード例 #1
0
 def test_insert_five(self):
     T = min_gap_tree([50, 38, 31, 12, 19])
     self.wrap(T, 38, 7) 
     self.wrap(T, 19, 7)
     self.wrap(T, 50, float("Inf"))
     self.wrap(T, 12, 7)
     self.wrap(T, 31, 7)
コード例 #2
0
 def test_delete_five(self):
     T = min_gap_tree([50, 38, 31, 12, 19, 9])
     T.delete(T.iterative_tree_search(9))
     T.delete(T.iterative_tree_search(12))
     T.delete(T.iterative_tree_search(19))
     T.delete(T.iterative_tree_search(31))
     T.delete(T.iterative_tree_search(38))
     self.wrap(T, 50, float("Inf"))
コード例 #3
0
 def test_delete_one(self):
     T = min_gap_tree([50, 38, 31, 12, 19, 9])
     T.delete(T.iterative_tree_search(9))
     self.wrap(T, 38, 7)
     self.wrap(T, 19, 7)
     self.wrap(T, 50, float("Inf"))
     self.wrap(T, 12, 7)
     self.wrap(T, 31, 7)
コード例 #4
0
 def test_insert_six(self):
     T = min_gap_tree([50, 38, 31, 12, 19, 9])
     self.wrap(T, 38, 3)
     self.wrap(T, 19, 3)
     self.wrap(T, 50, float("Inf"))
     self.wrap(T, 12, 3)
     self.wrap(T, 31, 7)
     self.wrap(T, 9, 3)
コード例 #5
0
 def test_delete_six(self):
     T = min_gap_tree([50, 38, 31, 12, 19, 9])
     T.delete(T.iterative_tree_search(9))
     T.delete(T.iterative_tree_search(12))
     T.delete(T.iterative_tree_search(19))
     T.delete(T.iterative_tree_search(31))
     T.delete(T.iterative_tree_search(38))
     T.delete(T.iterative_tree_search(50))
     self.assertEquals(T.root, T.nil)
コード例 #6
0
 def test_insert_two(self):
     T = min_gap_tree([50, 38])
     self.wrap(T, 50, 12)
     self.wrap(T, 38, 12)
コード例 #7
0
 def test_insert_one(self):
     T = min_gap_tree([50])
     self.wrap(T, 50, float("Inf"))
コード例 #8
0
 def test_insert_three(self):
     T = min_gap_tree([50, 38, 31])
     self.wrap(T, 38, 7)
     self.wrap(T, 31, 7)
     self.wrap(T, 50, float("Inf"))