示例#1
0
 def test_constructor_shouldCreateEmptySplayTree(self):
     bst = Treap()
     self.assertTrue(bst.empty())
     self.assertEqual(0, len(bst))
     self.assertEqual(-1, bst.height())
示例#2
0
 def test_deleteMax_withEmptyTree_shouldNotModifyTree(self):
     bst = Treap()
     bst.delete_max()
     self.assertEqual(0, len(bst))
     self.assertEqual(-1, bst.height())