FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Basic-Python-Hacktoberfest/Insertionsort.py at main · github-community-gitam/Basic-Python-Hacktoberfest · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
github-community-gitam
/
Basic-Python-Hacktoberfest
Public
Notifications
You must be signed in to change notification settings
Fork
10
Star
2
Code
Issues
9
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Basic-Python-Hacktoberfest
/
Insertionsort.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (15 loc) · 310 Bytes
Breadcrumbs
Basic-Python-Hacktoberfest
/
Insertionsort.py
Copy path
File metadata and controls
22 lines (15 loc) · 310 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
def
insertionSort
(
arr
):
for
i
in
range
(
1
,
len
(
arr
)):
key
=
arr
[
i
]
j
=
i
-
1
while
j
>=
0
and
key
<
arr
[
j
] :
arr
[
j
+
1
]
=
arr
[
j
]
j
-=
1
arr
[
j
+
1
]
=
key
arr
=
[
12
,
11
,
13
,
5
,
6
]
insertionSort
(
arr
)
lst
=
[]
print
(
"Sorted array is : "
)
for
i
in
range
(
len
(
arr
)):
lst
.
append
(
arr
[
i
])
print
(
lst
)
Back
|
FazBrowse Home
|
New Git URL