From 15578e80c647eab0f2ea98195fa886d1daf21613 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 19:49:10 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- sorts/adaptive_merge_sort.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sorts/adaptive_merge_sort.py b/sorts/adaptive_merge_sort.py index 60359d298..37119158c 100644 --- a/sorts/adaptive_merge_sort.py +++ b/sorts/adaptive_merge_sort.py @@ -24,6 +24,7 @@ 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. @@ -50,6 +51,7 @@ 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. @@ -73,5 +75,7 @@ def merge(array: list, aux: list, low: int, mid: int, high: int) -> None: else: aux[k] = array[i] i += 1 - array[low:high + 1] = aux[low:high + 1] # Update the main array with merged values + array[low : high + 1] = aux[ + low : high + 1 + ] # Update the main array with merged values print(f"After merge: {aux[low:high + 1]}")