Skip to content

Commit ab63cf5

Browse files
authored
Merge pull request powerexploit#3 from rcsm89/master
Create insert_sort.py
2 parents 74cd41c + b497949 commit ab63cf5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Scripts/insert_sort.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def insert_sort(_list):
2+
for i in range(1, len(_list)):
3+
elm = _list[i]
4+
k = i
5+
while not k <= 0 and _list[k - 1] > elm :
6+
_list[k] = _list[k - 1]
7+
k -= 1
8+
_list[k] = elm
9+
l = _list
10+
return l

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy