Q19
Which one of the following is TRUE?
Show answer without attempting
Answer: C
GATE CS · Algorithms · 7 questions
7 Algorithm Design questions from GATE CS papers (2014), each with the official answer key. Part of Algorithms. Answer any question right here and it is marked straight away, or practise them one at a time.
Answer: C
Answer: 34
Answer: 358
Answer: 150
Answer: B
Answer: D
size is the number of elements in the array E:int MyX(int *E, unsigned int size)
{
int Y = 0;
int Z;
int i, j, k;
for(i = 0; i < size; i++)
Y = Y + E[i];
for(i = 0; i < size; i++)
for(j = i; j < size; j++)
{
Z = 0;
for(k = i; k <= j; k++)
Z = Z + E[k];
if (Z > Y)
Y = Z;
}
return Y;
}MyX is theAnswer: A
0/70 correct0 marks