Skip to content
This repository was archived by the owner on Oct 24, 2020. It is now read-only.

Commit 967f1c7

Browse files
authored
Merge pull request kothariji#118 from adityamandal14/patch-1
Created Bubblesort.py
2 parents b798482 + c0a0119 commit 967f1c7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Sorting/BubbleSort.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def bubblesort(list):
2+
n=len(list)
3+
for i in range(n-1):
4+
for j in range(n-i-1):
5+
if list[j]>list[j+1]:
6+
list[j],list[j+1] = list[j+1],list[j]
7+
return list
8+
9+
L=input("Enter the array: ")
10+
print(bubblesort(L))

0 commit comments

Comments
 (0)