Пример #1
0
    def testNumChildrenWithTwoChildren(self):
        testNode = BSTNode(15)
        testNode.left = 10
        testNode.right = 30

        self.assertEqual(testNode.left, 10)
        self.assertEqual(testNode.right, 30)
Пример #2
0
    def testGetLenFollowingNode(self):
        rootNode = BSTNode(50)
        rootNode.left = BSTNode(25)
        rootNode.right = BSTNode(100)

        self.assertEqual(rootNode.getLenFollowingNode(), 3)
Пример #3
0
 def testGetrightWithChildren(self):
     testNode = BSTNode(15)
     testNode.right = 20
     self.assertEqual(testNode.getright(), 20)