Skip to content

Instantly share code, notes, and snippets.

@zhanglintc
Created August 26, 2020 12:35
Show Gist options
  • Save zhanglintc/e51bd89f9fe6fc507982f59f1d693ea8 to your computer and use it in GitHub Desktop.
Save zhanglintc/e51bd89f9fe6fc507982f59f1d693ea8 to your computer and use it in GitHub Desktop.
bubble sort
def bubble(a):
for i in range(len(a)):
for j in range(len(a) - i - 1):
if a[j] > a[j + 1]:
a[j], a[j + 1] = a[j + 1], a[j]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment