Skip to content

Commit fdef617

Browse files
committed
changed language of bubble_sort.py from portugese to english
1 parent 985b0fe commit fdef617

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/python/bubble_sort.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
""" Implementação do algoritmo bubble sort com recursão """
1+
"""
2+
Implementação do algoritmo bubble sort com recursão
3+
Implementation of the bubble sort algorithm with recursion
4+
"""
25

36

47
def bubble_sort(data, size):
58
"""
69
Implementação de um algoritmo de bubble sort com recursão.
7-
810
Argumentos:
911
data: lista. Lista que será ordenada
1012
size: int. Tamanho da lista
11-
1213
Retorna a lista "data" ordenada.
14+
15+
Implementation of a bubble sort algorithm with recursion.
16+
Arguments:
17+
data: list. List to be sorted
18+
size: int. List size
19+
Returns the ordered "date" list.
1320
"""
1421
swap = False
1522
for i in range(0, size - 1):
@@ -21,7 +28,7 @@ def bubble_sort(data, size):
2128

2229

2330
if __name__ == "__main__":
24-
lista_nao_ordenada = [2, 9, 8, 0, 1, 3, 5, 4, 6, 7]
25-
print(lista_nao_ordenada)
26-
bubble_sort(lista_nao_ordenada, len(lista_nao_ordenada))
27-
print(lista_nao_ordenada)
31+
unordered_list = [2, 9, 8, 0, 1, 3, 5, 4, 6, 7]
32+
print(unordered_list)
33+
bubble_sort(unordered_list, len(unordered_list))
34+
print(unordered_list)

0 commit comments

Comments
 (0)