コード例 #1
0
    def test_simple_rotation_with_right_right_tree(self):
        node_10 = create_not_zig_zag_tree_right()
        tree = AVL(node_10)
        returned_tree = tree._simple_rotation(tree.get_root())

        node_11 = tree.get_root()
        node_10 = node_11.get_left_child()
        node_12 = node_11.get_right_child()

        expect(node_10.get_key()).to.be.equal(10)
        expect(node_11.get_key()).to.be.equal(11)
        expect(node_12.get_key()).to.be.equal(12)
        expect(returned_tree).to.be.equal(node_11)