Q106
Consider the following naive method to find the maximum sub-array sum: #include int main() int arr[1000]=2, -1, 3, -4, 1, -2, -1, 5, -4, len=9; int cur_max, tmp_max, strt_idx, sub_arr_idx; cur_max = arr[0]; for(strt_idx = 0; strt_idx cur_max) _____________; printf("%d",cur_max); return 0; Which line should be inserted to complete the above code?
A.
tmp_max = cur_max
B.
break
C.
continue
D.
cur_max = tmp_max
AnswerAnswer: Option D
Solution
Answer: Option D
No explanation is given for this question Let's Discuss on Board