Write a python function to bubblesort an array


Topic: Write a python function to bubblesort an array

Solution

 
 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] 



List all Python Programs