Skip to content

Commit

Permalink
Update merge_sort_fastest.py
Browse files Browse the repository at this point in the history
  • Loading branch information
harshildarji authored May 21, 2018
1 parent 7f4b240 commit 71fd719
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions sorts/merge_sort_fastest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
def merge_sort(LIST):
start = []
end = []
while LIST:
while len(LIST) > 1:
a = min(LIST)
b = max(LIST)
start.append(a)
end.append(b)
try:
LIST.remove(a)
LIST.remove(b)
except ValueError:
continue
LIST.remove(a)
LIST.remove(b)
if LIST: start.append(LIST[0])
end.reverse()
return (start + end)

0 comments on commit 71fd719

Please sign in to comment.