Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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