Algorithms | Dynamic Programming | Question 4

Kadane algorithm is used to find:
(A) Maximum sum subsequence in an array
(B) Maximum sum subarray in an array
(C) Maximum product subsequence in an array
(D) Maximum product subarray in an array


Answer: (B)

Explanation: Kadane algorithm is used to find the maximum sum subarray in an array. It runs in O(n) time complexity. See details of the algorithm here.



My Personal Notes arrow_drop_up