Example #1
0
def newList(datastructure='SINGLE_LINKED'):
    """
    Crea una lista vacia
    """
    if (datastructure == "ARRAY_LIST"):
        lt = alt.newList()
    else:
        lt = slt.newList()
    return lt
Example #2
0
def newList(datastructure='SINGLE_LINKED', cmpfunction=None):
    """Crea una lista vacia.

    Args:
        cmpfunction: FunciĆ³n de comparaciĆ³n para los elementos de la lista
    Returns:
        Una nueva lista
    Raises:
        Exception
    """
    try:
        if (datastructure == "ARRAY_LIST"):
            lt = alt.newList(cmpfunction)
        else:
            lt = slt.newList(cmpfunction)
        return lt
    except Exception as exp:
        error.reraise(exp, 'list->newList: ')
def lstbooks(books):
    lst = slt.newList(cmpfunction)
    for i in range(0, 5):
        slt.addLast(lst, books[i])
    return lst
def lst():
    lst = slt.newList(cmpfunction)
    return lst
Example #5
0
def lstcasting(casting):
    lst = slt.newList(cmpfunction)
    for each in casting:
        slt.addLast(lst, each)
    return lst
Example #6
0
def lstpeliculas(peliculas):
    lst = slt.newList(cmpfunction)
    for each in peliculas:
        slt.addLast(lst, each)
    return lst