We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53826ff commit 5449d6fCopy full SHA for 5449d6f
Exercise-46-Merge_sort.py
@@ -1,17 +1,17 @@
1
def merge_sort(array):
2
- # derive the mid-point
+ # derive the mid-point..
3
if len(array) > 1:
4
mid = len(array) // 2
5
6
- # create the temp sub-arrays
+ # create the temp sub-arrays..
7
LEFT = array[:mid]
8
RIGHT = array[mid:]
9
10
# sort the first and second halves
11
merge_sort(LEFT)
12
merge_sort(RIGHT)
13
14
- # begin addig elements in sorted order
+ # begin addig elements in sorted order..
15
i, j, k = 0, 0, 1
16
17
while i < len(LEFT) and j < len(RIGHT):
@@ -23,7 +23,7 @@ def merge_sort(array):
23
j += 1
24
k += 1
25
26
- # copy the remaining data
+ # copy the remaining data..
27
while i < len(LEFT):
28
array[k] = LEFT[i]
29
i += 1
0 commit comments