We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 231d3bc commit f8f8ab9Copy full SHA for f8f8ab9
algorithms/app2.py
@@ -11,4 +11,5 @@
11
if f == True:
12
l[i], l[min] = l[min], l[i]
13
print(l)
14
-
+
15
+print("Sorted list: ", l)
algorithms/app3.py
@@ -0,0 +1,13 @@
1
+# Insertion sorting
2
+l = eval(input("Enter your number list: "))
3
+n = len(l)
4
+for i in range(n):
5
+ t = l[i]
6
+ k = i - 1
7
+ while k >=0 and l[k] > t:
8
+ l[k + 1] = l[k]
9
+ k = k- 1
10
+ l[k + 1] = t
+ print(l)
0 commit comments