Skip to content

Commit bfddd40

Browse files
committed
bubble sort
1 parent e5f8d72 commit bfddd40

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Day8/q33.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Implementation of bubble sort
2+
defbubble_Sort(l):
3+
n=len(l)
4+
foriinrange(n):
5+
forjinrange(0, n-i-1):
6+
ifl[j] >l[j+1]:
7+
l[j], l[j+1] =l[j+1], l[j]
8+
9+
10+
arr= [64, 34, 25, 12, 22, 11, 90]
11+
12+
bubble_Sort(arr)
13+
foriinrange(len(arr)):
14+
print(arr[i])

0 commit comments

Comments
 (0)
close