GATE CSE 2019 Q35: Maximum subarray sum of a 14-element sequence
- Algorithms
- 1 mark
- NAT
- No negative marking
Syllabus topic: Algorithm design techniques: greedy, dynamic programming and divide-and-conquer
Question
Consider a sequence of 14 elements: . The subsequence sum . Determine the maximum of , where . (Divide and conquer approach may be used.)
Answer: ________.
Try it: numerical answer: type the value
Show answer and explanation
Answer: 29 (official GATE 2019 final answer key)
Concept used: Maximum contiguous subarray sum, solvable by Kadane's algorithm or divide and conquer.
First step: Scan left to right keeping a running sum, resetting it to 0 whenever it goes negative, and track the best value seen.
Full step-by-step solution
Loading…
Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.
More questions on Algorithm design techniques: greedy, dynamic programming and divide-and-conquer
Every PYQ on this topic →Share this question
Source: official GATE 2019 CS question paper and final answer key, organised by IIT Madras. Question paper · Answer key
More Algorithms PYQs
- 2026 Session 1 · Q17Solve nested recurrences T1 = 4T1(n/2) + T2, T2 = 5T2(n/4) + log n
- 2026 Session 1 · Q41Shortest paths with at most k edges: two statements
- 2026 Session 1 · Q47Condition forcing a vertex into every minimum vertex cover
- 2026 Session 1 · Q49Cycle and cut properties of MSTs with distinct weights
- 2026 Session 1 · Q50Impossible DFS discovery/finish orderings for a DAG edge
- 2026 Session 1 · Q55Properties of 2-colorable (bipartite) graphs