Skip to content

Commit d57a2b5

Browse files
committed
Added Bubble Sort in Python
1 parent 60101af commit d57a2b5

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

BubbleSort/Python/BubbleSort.py

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

0 commit comments

Comments
 (0)