We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 99cf7d7 + ae63a27 commit 91920e1Copy full SHA for 91920e1
1 file changed
Bubblesort
@@ -0,0 +1,16 @@
1
+def BubSort(lis):
2
+ n = len(lis)
3
+ for i in range(0,n):
4
+ for j in range(0, n-i-1):
5
+ if lis[j] > lis[j+1] :
6
+ lis[j], lis[j+1] = lis[j+1], lis[j]
7
+
8
+n=input("Enter the number of values")
9
+lis=[]
10
+for i in range(n):
11
+ lis.append(input("Enter the value"))
12
13
+BubSort(lis)
14
+print ("Sorted array :")
15
+for i in range(len(lis)):
16
+ print ("%d" %lis[i])
0 commit comments