def bubble_sort_example():
    numbers = [5, 24, 18, 95, 45, 502, 1]

    for i in range(len(numbers)):
        for j in range(i, len(numbers)):
            if numbers[i] > numbers[j]:
                numbers[j], numbers[i] = numbers[i], numbers[j]


    print(numbers)

def insertion_sort_example():
    numbers = [5, 24, 18, 95, 502, 45, 1]

    for i in range(1, len(numbers)):
        for j in range(i - 1, -1, -1):
            if numbers[j] > numbers[j + 1]:
                numbers[j + 1], numbers[j] = numbers[j], numbers[j + 1]
            else:
                break

    print(numbers)

# bubble_sort_example();
insertion_sort_example();
