Skip to content

Commit 5449d6f

Browse files
authored
Update Exercise-46-Merge_sort.py
1 parent 53826ff commit 5449d6f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Exercise-46-Merge_sort.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
def merge_sort(array):
2-
# derive the mid-point
2+
# derive the mid-point..
33
if len(array) > 1:
44
mid = len(array) // 2
55

6-
# create the temp sub-arrays
6+
# create the temp sub-arrays..
77
LEFT = array[:mid]
88
RIGHT = array[mid:]
99

1010
# sort the first and second halves
1111
merge_sort(LEFT)
1212
merge_sort(RIGHT)
1313

14-
# begin addig elements in sorted order
14+
# begin addig elements in sorted order..
1515
i, j, k = 0, 0, 1
1616

1717
while i < len(LEFT) and j < len(RIGHT):
@@ -23,7 +23,7 @@ def merge_sort(array):
2323
j += 1
2424
k += 1
2525

26-
# copy the remaining data
26+
# copy the remaining data..
2727
while i < len(LEFT):
2828
array[k] = LEFT[i]
2929
i += 1

0 commit comments

Comments
 (0)