Skip to content

Commit 4a0f090

Browse files
authored
Update adaptive_merge_sort.py
1 parent cd6fca8 commit 4a0f090

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sorts/adaptive_merge_sort.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
def adaptive_merge_sort(sequence: list) -> list:
22
"""
33
Sorts a list using the Adaptive Merge Sort algorithm.
4-
4+
55
>>> adaptive_merge_sort([4, 3, 1, 2])
66
Initial sequence: [4, 3, 1, 2]
77
Sorting: array[0:2] and array[2:4]
@@ -22,11 +22,10 @@ def adaptive_merge_sort(sequence: list) -> list:
2222
print(f"Sorted sequence: {sequence}")
2323
return sequence
2424

25-
2625
def adaptive_merge_sort_helper(array: list, aux: list, low: int, high: int) -> None:
2726
"""
2827
Helper function for Adaptive Merge Sort algorithm.
29-
28+
3029
>>> adaptive_merge_sort_helper([4, 3, 1, 2], [4, 3, 1, 2], 0, 3)
3130
Sorting: array[0:2] and array[2:4]
3231
Sorting: array[0:1] and array[1:2]
@@ -48,7 +47,6 @@ def adaptive_merge_sort_helper(array: list, aux: list, low: int, high: int) -> N
4847
return
4948
merge(array, aux, low, mid, high)
5049

51-
5250
def merge(array: list, aux: list, low: int, mid: int, high: int) -> None:
5351
"""
5452
Merges two sorted subarrays of the main array.

0 commit comments

Comments
 (0)