Gate2019 cs Q35

0. Consider a sequence of 14 elements: A = [−5, −10, 6, 3, −1, −2, 13, 4, −9, −1, 4, 12, −3, 0].


Note – Numerical Type question

  • Option : A
  • Explanation :
    According to largest Sum Contiguous subarray is from index 2 to 11,
    Max (S(i, j))
    = S(2, 11)
    = 6 + 3 + (-1) + (-2) + 13 + 4 + (-9) + (-1) + 4 + 12
    = 29
    So, answer is 29.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *