Vidyalelo
Data Structure · Q54

Dynamic Programming in Data Structures

Programming · Data Structure · question 54

Q54

Consider the following code snippet. Which property is shown by line 4 of the below code snippet? 1. int sum[len], idx; 2. sum[0] = arr[0]; 3. for(idx = 1; idx mx) 8. mx =sum[idx]; 9. return mx;

A.
Optimal substructure
Answer
B.
Overlapping subproblems
C.
Both overlapping subproblems and optimal substructure
D.
Greedy substructure

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board