• Toes♀@ani.social
    link
    fedilink
    arrow-up
    19
    ·
    edit-2
    3 months ago

    Let me help you sort things out

    def bubbleSort(arr):
    
        n = len(arr)
    
        for i in range(n-1):
    
            for j in range(0, n-i-1):
    
                if arr[j] > arr[j+1]:
    
                    arr[j], arr[j+1] = arr[j+1], arr[j]
    
    #https://www.sortvisualizer.com/bubblesort/