Skip to content

Instantly share code, notes, and snippets.

@gomta777
Created October 9, 2019 16:29
Show Gist options
  • Select an option

  • Save gomta777/2471b1cdafa29743cf74c963a00b893b to your computer and use it in GitHub Desktop.

Select an option

Save gomta777/2471b1cdafa29743cf74c963a00b893b to your computer and use it in GitHub Desktop.
def bubblesort(datalist):
for x in range(len(datalist)):
for y in reversed(range(x + 1, len(datalist))):
if datalist[y-1] > datalist[y]:
datalist[y], datalist[y-1] = datalist[y-1], datalist[y]
# バブルソートの実装
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment