def test_rank(self):
     tree = BSTree([70, 50, 200, 30, 60, 55, 100, 300, 80, 150])
     self.assertEqual(tree.rank(30), 0)
     self.assertEqual(tree.rank(50), 1)
     self.assertEqual(tree.rank(55), 2)
     self.assertEqual(tree.rank(60), 3)
     self.assertEqual(tree.rank(70), 4)
     self.assertEqual(tree.rank(200), 8)
     self.assertEqual(tree.rank(300), 9)
 def test_select_rank_are_inverses(self):
     tree = BSTree([70, 50, 200, 30, 60, 55, 100, 300, 80, 150])
     self.assertEqual(tree.select(tree.rank(30)), 30)
     self.assertEqual(tree.select(tree.rank(50)), 50)
     self.assertEqual(tree.select(tree.rank(55)), 55)
     self.assertEqual(tree.select(tree.rank(60)), 60)
     self.assertEqual(tree.select(tree.rank(70)), 70)
     self.assertEqual(tree.select(tree.rank(200)), 200)
     self.assertEqual(tree.select(tree.rank(300)), 300)