Skip to content

Commit 2ab90df

Browse files
committed
1 parent d848bfb commit 2ab90df

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

Diff for: .vs/ProjectSettings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"CurrentProjectSetting": null
3+
}

Diff for: .vs/Python/v16/.suo

22.5 KB
Binary file not shown.

Diff for: .vs/slnx.sqlite

424 KB
Binary file not shown.

Diff for: sorts/merge_insertion_sort.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,9 @@ def merge(left, right):
158158
->
159159
[40, 75, 100, 999, 10000]
160160
"""
161-
is_last_odd_item_inserted_before_this_index = False
162161
for i in range(len(sorted_list_2d) - 1):
163-
if result[i] == collection[-i]:
164-
is_last_odd_item_inserted_before_this_index = True
165162
pivot = sorted_list_2d[i][1]
166-
# If last_odd_item is inserted before the item's index,
167-
# you should forward index one more.
168-
if is_last_odd_item_inserted_before_this_index:
169-
result = result[: i + 2] + binary_search_insertion(result[i + 2 :], pivot)
170-
else:
171-
result = result[: i + 1] + binary_search_insertion(result[i + 1 :], pivot)
172-
163+
result = result[: i + 1] + binary_search_insertion(result[i + 1 :], pivot)
173164
return result
174165

175166

0 commit comments

Comments
 (0)