Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb497949

Browse files
authored
Create insert_sort.py
insert_sort in python
1 parenta3211f8 commitb497949

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+
definsert_sort(_list):
2+
foriinrange(1,len(_list)):
3+
elm=_list[i]
4+
k=i
5+
whilenotk<=0and_list[k-1]>elm :
6+
_list[k]=_list[k-1]
7+
k-=1
8+
_list[k]=elm
9+
l=_list
10+
returnl

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp