Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
93844478
Commit
93844478
authored
Oct 10, 2019
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
08e45a4e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
14 deletions
+0
-14
merge_sort.py
eda/merge_sort.py
+0
-14
No files found.
eda/merge_sort.py
deleted
100644 → 0
View file @
08e45a4e
def
merge_sort
(
lst
):
if
len
(
lst
)
<=
1
:
return
lst
middle
=
int
(
len
(
lst
)
/
2
)
left
=
merge_sort
(
lst
[:
middle
])
right
=
merge_sort
(
lst
[
middle
:])
merged
=
[]
while
left
and
right
:
merged
.
append
(
left
.
pop
(
0
)
if
left
[
0
]
<=
right
[
0
]
else
right
.
pop
(
0
))
merged
.
extend
(
right
if
right
else
left
)
return
merged
data_lst
=
[
6
,
202
,
100
,
301
,
38
,
8
,
1
]
print
(
merge_sort
(
data_lst
))
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment