Created
February 5, 2017 11:46
-
-
Save rjshekar90/b52a2848a7a2f9659ca5bde2cdfc12d5 to your computer and use it in GitHub Desktop.
This file contains 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 bubbleSort(lst): | |
nums = list(lst) | |
for i in range(len(lst)): | |
for j in range(i+1, len(lst)): | |
if lst[j] < lst[i]: | |
lst[j], lst[i] = lst[i], lst[j] | |
return lst | |
print bubbleSort([100,90,80,70,2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment