53. Maximum Subarray - divide and conquer

1
2
class Solution:
def maxSubArray(self, nums):
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
CLRS chap 4

2 Responses

Note the range() function does not include upper bound. so len(nums) is not included.
But in list selection, high need to be exactly len(nums)
Thus error.
@Yuqiong Li also Status: Time Limit Exceeded.
The mid point calculation is O(n)
But recursion is ??
Calculate the time complexity of this algorithm...

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.