6,841 views
3 votes
3 votes

Maximum Subarray Sum problem is to find the subarray with maximum sum. For example, given an array {12, -13, -5, 25, -20, 30, 10}, the maximum subarray sum is 45. The naive solution for this problem is to calculate sum of all subarrays starting with every element and return the maximum of all. We can solve this using Divide and Conquer, what will be the worst case time complexity using Divide and Conquer.

A

O(n)

B

O(nLogn)

C

O(Logn)

D O(n2)

Correct answer is B. O(nLogn) How? 

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
1
Emankashyap asked Apr 30
75 views
In quick sort, n numbers the (n/10)th element is selected as pivot using n^2 sortimng time complexity what will be the time complexity of quick sort is.....a)O(nlogn)b)O(...
0 votes
0 votes
0 answers
3
Huzaifa0111 asked Aug 27, 2023
172 views