def test__AVLTree_is_avl_satisified2(): avl = AVLTree() avl.root = Node(0) avl.root.right = Node(1) avl.root.right.right = Node(2) assert avl.is_bst_satisfied() assert not avl.is_avl_satisfied()
def test__AVLTree_is_avl_satisified0(): avl = AVLTree() avl.root = Node(0) avl.root.left = Node(-1) avl.root.left.left = Node(-2) assert avl.is_bst_satisfied() assert not avl.is_avl_satisfied()
def test__AVLTree_insert(xs): xs = list(set(xs)) avl = AVLTree() for x in xs: avl.insert(x) assert x in avl.to_list('inorder') assert avl.is_bst_satisfied() assert avl.is_avl_satisfied()
def test__AVLTree_is_avl_satisified9(): avl = AVLTree() avl.root = Node(0) avl.root.left = Node(-2) avl.root.left.left = Node(-3) avl.root.left.left.left = Node(-4) avl.root.left.left.left.left = Node(-5) avl.root.left.right = Node(-1) avl.root.right = Node(2) avl.root.right.left = Node(1) avl.root.right.right = Node(3) avl.root.right.right.right = Node(4) assert avl.is_bst_satisfied() assert not avl.is_avl_satisfied()
def test__AVLTree___init__(xs): xs = list(set(xs)) avl = AVLTree(xs) assert avl.is_bst_satisfied() assert avl.is_avl_satisfied()
def test__AVLTree_is_avl_satisified5(): avl = AVLTree() avl.root = Node(0) assert avl.is_bst_satisfied() assert avl.is_avl_satisfied()
def test__AVLTree_is_avl_satisified4(): avl = AVLTree() assert avl.is_bst_satisfied() assert avl.is_avl_satisfied()