Bubble Sort, Bubble Sort Algorithm, Data Structure Algorithm, Dsa Courses, Naem Azam.
bubbleSort(arr): n = len(arr) #Traversing through all array elements for i in range(n): for j in range(0, n-i-1): #Traversing the array from 0 to n-i-1 #Swap if the element found is greater than the next element if arr[j] > arr[j+1] : #Swapping arr[j], arr[j+1] = arr[j+1], arr[j] # Driver code arr