Skip to content

Commit e58c462

Browse files
committed
Bubble Sort
1 parent 2636f3c commit e58c462

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Diff for: BubbleSort.python

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
3+
array=[];
4+
5+
# input
6+
print ("Enter any 6 Numbers for Unsorted Array : ");
7+
for i in range(0, 6):
8+
n=input();
9+
array.append(int(n));
10+
11+
# Sorting
12+
print("")
13+
for i in range(0, 6):
14+
for j in range(0,5):
15+
if (array[j]>array[j+1]):
16+
temp=array[j];
17+
array[j]=array[j+1];
18+
array[j+1]=temp;
19+
20+
# Output
21+
for i in range(0,6):
22+
print(array[i]);
23+
24+
25+
26+

0 commit comments

Comments
 (0)