Skip to content

Commit 8244861

Browse files
authored
Python
1 parent 4c0a70c commit 8244861

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Insertion Sort/insertion_sort.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def InsertionSort(arr):
2+
for i in range(1, len(arr)):
3+
for j in range(i, 0, -1):
4+
if(arr[j-1] <= arr[j]):
5+
break
6+
arr[j], arr[j-1] = arr[j-1], arr[j]
7+
return arr

0 commit comments

Comments
 (0)