Skip to content

Commit 91c06ae

Browse files
committed
Update max_subarray_sum.py
1 parent 5f9c45e commit 91c06ae

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

algorithms/divide_and_conquer/max_subarray_sum.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""
2-
Given a array of length n, max_subarray_sum() finds
2+
Given an array of length n, max_subarray_sum() finds
33
the maximum of sum of contiguous sub-array using divide and conquer method.
44
55
Time complexity : O(n log n)
66
77
Ref : INTRODUCTION TO ALGORITHMS THIRD EDITION
8-
(section : 4, sub-section : 4.1, page : 70)
8+
(section : 4, subsection : 4.1, page : 70)
99
1010
"""
1111

@@ -40,8 +40,8 @@ def max_cross_array_sum(array, left, mid, right):
4040
4141
"""
4242

43-
max_sum_of_left = max_sum_from_start(array[left : mid + 1][::-1])
44-
max_sum_of_right = max_sum_from_start(array[mid + 1 : right + 1])
43+
max_sum_of_left = max_sum_from_start(array[left: mid + 1][::-1])
44+
max_sum_of_right = max_sum_from_start(array[mid + 1: right + 1])
4545
return max_sum_of_left + max_sum_of_right
4646

4747

0 commit comments

Comments
 (0)