From 4a0f090f54278931598d21a3e08e041c02b386e5 Mon Sep 17 00:00:00 2001 From: ANANT JAIN <139585700+anant-jain01@users.noreply.github.com> Date: Thu, 17 Oct 2024 01:04:07 +0530 Subject: [PATCH] Update adaptive_merge_sort.py --- sorts/adaptive_merge_sort.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sorts/adaptive_merge_sort.py b/sorts/adaptive_merge_sort.py index 9cbee4b40..07cb459e4 100644 --- a/sorts/adaptive_merge_sort.py +++ b/sorts/adaptive_merge_sort.py @@ -1,7 +1,7 @@ def adaptive_merge_sort(sequence: list) -> list: """ Sorts a list using the Adaptive Merge Sort algorithm. - + >>> adaptive_merge_sort([4, 3, 1, 2]) Initial sequence: [4, 3, 1, 2] Sorting: array[0:2] and array[2:4] @@ -22,11 +22,10 @@ def adaptive_merge_sort(sequence: list) -> list: print(f"Sorted sequence: {sequence}") return sequence - def adaptive_merge_sort_helper(array: list, aux: list, low: int, high: int) -> None: """ Helper function for Adaptive Merge Sort algorithm. - + >>> adaptive_merge_sort_helper([4, 3, 1, 2], [4, 3, 1, 2], 0, 3) Sorting: array[0:2] and array[2:4] 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 return merge(array, aux, low, mid, high) - def merge(array: list, aux: list, low: int, mid: int, high: int) -> None: """ Merges two sorted subarrays of the main array.