Ejemplo n.º 1
0
def execute_operation(operation, struck_type):
    num = 0

    if operation == "Add" or operation == "Delete":

        num = get_input()

        if operation == "Add":
            print(str(Manager.add_item(num, struck_type)))
        else:
            print(str(Manager.delete_item(num, struck_type)))
    else:
        print(str(Manager.show_item(struck_type)))
Ejemplo n.º 2
0
def execute_operation(operation, struck_type):
    num = 0

    if operation == "Add" or operation == "Delete" or operation == "Move":

        if operation == "Add":

            num = get_input()
            print(str(Manager.add_item(num, struck_type)))

        elif operation == "Move":
            movement_op(struck_type)

        else:
            if struck_type == "lista" or struck_type == "arbol binario" or struck_type == "arbol AVL":
                num = get_input()
                print(str(Manager.delete_item(num, struck_type)))
            else:
                num = 0
                print(str(Manager.delete_item(num, struck_type)))
    else:
        print(str(Manager.show_item(struck_type)))