We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e58c462 commit 5e3a0d4Copy full SHA for 5e3a0d4
InsertionSort.python
@@ -0,0 +1,27 @@
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(1, 6):
14
+ temp=array[i]
15
+ j=i-1;
16
+ while(j>=0 and temp<array[j]):
17
+ array[j+1]=array[j];
18
+ j-=1;
19
+ array[j+1]=temp;
20
21
+# Output
22
+for i in range(0,6):
23
+ print(array[i]);
24
25
26
27
0 commit comments