def main():
    """

    """

    sorted_array = sorted([1, 2, 5, 621, 23, 24])
    root = get_binary_tree(sorted_array)
예제 #2
0
def main():
    """

    """

    sorted_array = sorted([1, 2, 5, 621, 23, 24, 4])
    root = get_binary_tree(sorted_array)
    print("is_bst = {}".format(is_bst(root)))
def main():
    """

    """

    sorted_array = sorted([1, 2, 5, 621, 623])
    root = get_binary_tree(sorted_array)
    print(root)
예제 #4
0
def main():
    """

    """

    sorted_array = sorted([1, 2, 3, 4, 5, 6])
    root = get_binary_tree(sorted_array)
    print(get_combo([root]))
예제 #5
0
def main():
    """

    """

    sorted_array = sorted([1, 2, 5, 621, 23, 24])
    root = get_binary_tree(sorted_array)
    is_balanced_, depth = is_balanced(root)
    # debug
    print("is_balanced_ = {}".format(is_balanced_))
예제 #6
0
def main():
    """

    """

    sorted_array = sorted([1, 2, 3, 5, 621, 81, 23])
    root = get_binary_tree(sorted_array)
    print(root)

    print(linked_list_depth(root))
    print(linked_list_depth2(root))
예제 #7
0
def main():
    """

    """

    sorted_array = sorted([1, 2, 5, 621, 23, 24, 4, 3, 2.1, 30, 31])
    # debug
    print("root = {}".format(sorted_array))
    
    root = get_binary_tree(sorted_array)
    # debug
    print("root = {}".format(root))
    root.left.left.right.right = BinNode(2.001)
    root.left.left.right.right._parent = root.left.left.right
    print((root.right.right.right))