Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit d357be4

Browse files
Update bubble_sort.py
1 parent 2e7f4a9 commit d357be4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

sorting/bubble_sort.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3-
# author: bt3gl
43

54

6-
def bubble_sort(list)
5+
def bubble_sort(array)
76

87
has_swapped = True
98

109
while has_swapped:
1110
has_swapped = False
1211

13-
for i in range(len(lst) - 1):
14-
if lst[i] > lst[i + 1]:
15-
lst[i], lst[i + 1] = lst[i + 1], lst[i]
12+
for i in range(len(array) - 1):
13+
if array[i] > array[i + 1]:
14+
array[i], array[i + 1] = array[i + 1], array[i]
1615
has_swapped = True

0 commit comments

Comments
 (0)