bubble sort

Run Settings
LanguagePython
Language Version
Run Command
def bubble_sort(lst): sorted_ = False while not sorted_: sorted_ = True for i in range(len(lst) - 1): print(*lst) print(' ' * i + '^ ^') if lst[i] > lst[i + 1]: sorted_ = False lst[i], lst[i + 1] = lst[i + 1], lst[i] print(*lst) print(' ' * i + '^ ^') bubble_sort([1, 3, 2, 5, 4, 8, 9, 7, 6, 0])
Editor Settings
Theme
Key bindings
Full width
Lines