Exemplo n.º 1
0
 def test_DeleteNodeByKeyOneNode(self):
     testKey = 0
     tree = BST(BSTNode(testKey, testKey, None))
     self.assertTrue(tree.FindNodeByKey(testKey).NodeHasKey)
     self.assertTrue(tree.DeleteNodeByKey(testKey))
     self.assertFalse(tree.FindNodeByKey(testKey).NodeHasKey)
     self.assertTrue(tree.Root is None)
Exemplo n.º 2
0
 def test_DeleteNodeByKeyEmpty(self):
     tree = BST(None)
     self.assertFalse(tree.DeleteNodeByKey(0))