Пример #1
0
        The sorted list
    """

    for i in range(1, len(array)):
        iteration = array[i]
        index = i

        while iteration < array[index-1] and index > 0:
            array[index] = array[index - 1]
            index -= 1

        array[index] = iteration


    return array



if __name__ == '__main__':
    m = Manipulate()

    with open('../data.txt', 'r') as textFile:
        objects = [m.countNonAlpha(i.strip()) for i in textFile.readlines()]

    t1 = time.perf_counter()

    # Will take ~24 minute(s) to complete if minimum system requirements are met
    print(insertion_sort(objects))

    t2 = time.perf_counter()
    print(f"Insertion Sort finished in {t2-t1} seconds. Array size: {len(objects)}")