Skip to content

Instantly share code, notes, and snippets.

@barrysteyn
Created November 16, 2012 22:31
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 barrysteyn/4091524 to your computer and use it in GitHub Desktop.
Save barrysteyn/4091524 to your computer and use it in GitHub Desktop.
Bubble sort algorithm in pythong
for i in range(len(array_to_sort),0,-1):
for j in range(i-1):
if (array_to_sort[j] > array_to_sort[j+1]):
temp = array_to_sort[j];
array_to_sort[j] = array_to_sort[j+1];
array_to_sort[j+1] = temp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment