Skip to content

Commit 76b9113

Browse files
committed
Bubble sort test
1 parent 1fd6692 commit 76b9113

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

codeflash/bubble_sort.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def sorter(arr):
2+
for i in range(len(arr)):
3+
for j in range(len(arr) - 1):
4+
if arr[j] > arr[j + 1]:
5+
temp = arr[j]
6+
arr[j] = arr[j + 1]
7+
arr[j + 1] = temp
8+
return arr

0 commit comments

Comments
 (0)