Skip to content

Instantly share code, notes, and snippets.

@BMU-Verlag
Created May 26, 2020 06:58
Show Gist options
  • Save BMU-Verlag/6ea376955ad51ca88beedd7830253bca to your computer and use it in GitHub Desktop.
Save BMU-Verlag/6ea376955ad51ca88beedd7830253bca to your computer and use it in GitHub Desktop.
def bubble_sort(numbers):
swapped = false
while (swapped):
for 1 <= i < n:
if numbers[i] > numbers[i+1]:
swap(numbers[i], numbers[i+1])
swapped = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment