MCQ1 mark
Consider the equality and the following choices for
I.
II.
III.
IV.
The equality above remains correct if is replaced by
Single correct
GATE CSE previous year questions · Algorithms
Single correct
Single correct
Single correct
Numerical answer
DOSOMETHING (c, a, n)
z ← 1
for i ← 0 to k − 1
do z ← z² mod n
if c[i] = 1
then z ← (z × a) mod n
return z
If , , and , then the output of DOSOMETHING is _____.Numerical answer
Single correct

Numerical answer
Single correct
Numerical answer
Single correct
listA contains n (> 0) elements, sorted in ascending order.
int ProcessArray(int *listA, int x, int n)
{
int i, j, k;
i = 0;
j = n-1;
do {
k = (i+j)/2;
if (x <= listA[k])
j = k-1;
if (listA[k] <= x)
i = k+1;
}while (i <= j);
if (listA[k] == x)
return(k);
else
return -1;
}
Which one of the following statements about the function ProcessArray is CORRECT?Single correct