Skip to content

Commit 5a0c7ec

Browse files
author
Benjamin Fein
committed
Removes double #.
1 parent f087db3 commit 5a0c7ec

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

sorts/recursive_mergesort_array.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ def merge(arr: list[int]) -> list[int]:
1717
[]
1818
"""
1919
if len(arr) > 1:
20-
middle_length = len(arr) // 2 ##Finds the middle of the array
20+
middle_length = len(arr) // 2 # Finds the middle of the array
2121
left_array = arr[
2222
:middle_length
23-
] ##Creates an array of the elements in the first half.
23+
] # Creates an array of the elements in the first half.
2424
right_array = arr[
2525
middle_length:
26-
] ##Creates an array of the elements in the second half.
26+
] # Creates an array of the elements in the second half.
2727
left_size = len(left_array)
2828
right_size = len(right_array)
29-
merge(left_array) ## Starts sorting the left.
30-
merge(right_array) ##Starts sorting the right
31-
left_index = 0 ##Left Counter
32-
right_index = 0 ## Right Counter
33-
index = 0 ## Position Counter
29+
merge(left_array) # Starts sorting the left.
30+
merge(right_array) # Starts sorting the right
31+
left_index = 0 # Left Counter
32+
right_index = 0 # Right Counter
33+
index = 0 # Position Counter
3434
while (
3535
left_index < left_size and right_index < right_size
36-
): ##Runs until the lowers size of the left and right are sorted.
36+
): # Runs until the lowers size of the left and right are sorted.
3737
if left_array[left_index] < right_array[right_index]:
3838
arr[index] = left_array[left_index]
3939
left_index = left_index + 1
@@ -43,13 +43,13 @@ def merge(arr: list[int]) -> list[int]:
4343
index = index + 1
4444
while (
4545
left_index < left_size
46-
): ##Adds the left over elements in the left half of the array
46+
): # Adds the left over elements in the left half of the array
4747
arr[index] = left_array[left_index]
4848
left_index = left_index + 1
4949
index = index + 1
5050
while (
5151
right_index < right_size
52-
): ##Adds the left over elements in the right half of the array
52+
): # Adds the left over elements in the right half of the array
5353
arr[index] = right_array[right_index]
5454
right_index = right_index + 1
5555
index = index + 1

0 commit comments

Comments
 (0)