Created
August 8, 2013 00:20
-
-
Save ngenator/6180272 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def bubble_sort(to_sort): | |
for i in range(len(to_sort) - 1): | |
for j in range(len(to_sort) - 1): | |
if to_sort[j+1] < to_sort[j]: | |
temp = to_sort[j] | |
to_sort[j] = to_sort[j+1] | |
to_sort[j+1] = temp | |
return to_sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment