Skip to content

Instantly share code, notes, and snippets.

@pedrovanzella
Created October 13, 2014 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedrovanzella/c9fd10c8a8d30b78dd97 to your computer and use it in GitHub Desktop.
Save pedrovanzella/c9fd10c8a8d30b78dd97 to your computer and use it in GitHub Desktop.
def bubblesort(list):
length = len(list) - 1
sorted = False
while not sorted:
sorted = True
for i in range(length):
if list[i] > list[i+1]:
sorted = False
list[i], list[i+1] = list[i+1], list[i]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment