Skip to content

Commit 31061aa

Browse files
authored
fix: use += in sorts/recursive_mergesort_array.py (TheAlgorithms#5019)
1 parent cb4dc19 commit 31061aa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: sorts/recursive_mergesort_array.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,23 @@ def merge(arr: list[int]) -> list[int]:
3838
): # Runs until the lowers size of the left and right are sorted.
3939
if left_array[left_index] < right_array[right_index]:
4040
arr[index] = left_array[left_index]
41-
left_index = left_index + 1
41+
left_index += 1
4242
else:
4343
arr[index] = right_array[right_index]
44-
right_index = right_index + 1
45-
index = index + 1
44+
right_index += 1
45+
index += 1
4646
while (
4747
left_index < left_size
4848
): # Adds the left over elements in the left half of the array
4949
arr[index] = left_array[left_index]
50-
left_index = left_index + 1
51-
index = index + 1
50+
left_index += 1
51+
index += 1
5252
while (
5353
right_index < right_size
5454
): # Adds the left over elements in the right half of the array
5555
arr[index] = right_array[right_index]
56-
right_index = right_index + 1
57-
index = index + 1
56+
right_index += 1
57+
index += 1
5858
return arr
5959

6060

0 commit comments

Comments
 (0)