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.

GATE CS Corner    Company Wise Coding Practice

Recommended Posts:



0 Average Difficulty : 0/5.0
No votes yet.