diff --git a/bubble_sort.py b/bubble_sort.py new file mode 100644 index 0000000..4112d17 --- /dev/null +++ b/bubble_sort.py @@ -0,0 +1,8 @@ +def bubble_sort(lista): + fim = len(lista) + for i in range(fim-1, 0, -1): + for j in range(i): + if lista[j] > lista[j+1]: + lista[j], lista[j+1] = lista[j+1], lista[j] + print(lista) + return lista