<jupyter_start><jupyter_text>Bubble SortBubble sort is one of the simplest sorting algorihtms to understand, however it is also one of the most inefficient. In the worst case the time complexity is O(n²)<jupyter_code>import random

def bubblesort(input_array):
    length = len(input_array)
    for i in range(length):
        for j in range(length - 1):
            if input_array[j] > input_array[j + 1]:
                input_array[j], input_array[j + 1] = input_array[j + 1], input_array[j]
    return input_array
                
bubblesort([random.random() for i in range(10)])<jupyter_output><empty_output>