Skip to content

Instantly share code, notes, and snippets.

Created Nov 29, 2020
What would you like to do?
def bubble_sort(array):
n = len(array)
for i in range(n):
for j in range(0, n-i-1):
if array[j] > array[j+1]:
array[j], array[j+1] = array[j+1], array[j]
array = [64, 56, 78, 34, 98, 32, 67]
print("Sorted array using Bubble Sort Algorithm : ")
for i in range(len(array)):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment