Exemplo n.º 1
0
 def test_insert_five(self):
     T = bh_tree([41, 38, 31, 12, 19])
     self.wrap(T, 38, 2)
     self.wrap(T, 19, 1)
     self.wrap(T, 41, 1)
     self.wrap(T, 12, 1)
     self.wrap(T, 31, 1)
Exemplo n.º 2
0
 def test_delete_five(self):
     T = bh_tree([41, 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, 41, 1)
Exemplo n.º 3
0
 def test_delete_two(self):
     T = bh_tree([41, 38, 31, 12, 19, 9])
     T.delete(T.iterative_tree_search(9))
     T.delete(T.iterative_tree_search(12))
     self.wrap(T, 38, 2)
     self.wrap(T, 19, 1)
     self.wrap(T, 41, 1)
     self.wrap(T, 31, 1)
Exemplo n.º 4
0
 def test_insert_six(self):
     T = bh_tree([41, 38, 31, 12, 19, 9])
     self.wrap(T, 38, 2)
     self.wrap(T, 19, 2)
     self.wrap(T, 41, 1)
     self.wrap(T, 12, 1)
     self.wrap(T, 31, 1)
     self.wrap(T, 9, 1)
Exemplo n.º 5
0
 def test_delete_six(self):
     T = bh_tree([41, 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(41))
     self.assertEquals(T.root, T.nil)
Exemplo n.º 6
0
 def test_insert_two(self):
     T = bh_tree([41, 38])
     self.wrap(T, 41, 1)
     self.wrap(T, 38, 1)
Exemplo n.º 7
0
 def test_insert_one(self):
     T = bh_tree([41])
     self.wrap(T, 41, 1)
Exemplo n.º 8
0
 def test_insert_four(self):
     T = bh_tree([41, 38, 31, 12])
     self.wrap(T, 38, 2)
     self.wrap(T, 31, 1)
     self.wrap(T, 41, 1)
     self.wrap(T, 12, 1)
Exemplo n.º 9
0
 def test_insert_three(self):
     T = bh_tree([41, 38, 31])
     self.wrap(T, 38, 1)
     self.wrap(T, 31, 1)
     self.wrap(T, 41, 1)