GATE CSE
T(1) = 2T (n/2) + log n
t0 = i * 1024
t1 = j * 32
t2 = k * 4
t3 = t1 + t0
t4 = t3 + t2
t5 = X[t4]
Which one of the following statements about the source code for the C program is CORRECT?Consider the grammar defined by the following production rules, with two operators * and +
$$\eqalign{ & S \to T*P \cr & T \to U\,|\,T*U \cr & P \to Q + P\,|\,Q \cr & Q \to id \cr & U \to id \cr} $$Which one of the following is TRUE?


Q—R1—R2—R3—H
H acts as an HTTP server, and Q connects to H via HTTP and downloads a file. Session layer encryption is used, with DES as the shared key encryption protocol. Consider the following four pieces of information:
$$[I1]$$ The URL of the file downloaded by Q
$$[I2]$$ The TCP port numbers at Q and H
$$[I3]$$ The IP addresses of Q and H
$$[I4]$$ The link layer addresses of Q and H

Select * from R where a in (select S.a from S)


For (StudentName, StudentAge) to be a key for this instance, the value $$X$$ should NOT be equal to ________.
Consider the following two statements:
S1 There is a subset of S that is larger than every other subset.
Which one of the following is CORRECT?
the matrix $$\left[ {\matrix{ 1 & 0 & 0 & 0 & 1 \cr 0 & 1 & 1 & 1 & 0 \cr 0 & 1 & 1 & 1 & 0 \cr 0 & 1 & 1 & 1 & 0 \cr 1 & 0 & 0 & 0 & 1 \cr } } \right]$$ is ____ .
semaphore n = 0;
semaphore s = 1;
void producer()
{
while(true)
{
produce();
semWait(s);
addToBuffer();
semSignal(s);
semSignal(n);
}
}
void consumer()
{
while(true)
{
semWait(s);
semWait(n);
removeFromBuffer();
semSignal(s);
consume();
}
}
Which one of the following is TRUE?Process id | tc | tio |
---|---|---|
A | 100 ms | 500 ms |
B | 350 ms | 500 ms |
C | 200 ms | 500 ms |
The processes $$A, B,$$ and $$C$$ are started at times $$0, 5$$ and $$10$$ milliseconds respectively, in a pure time sharing system (round robin scheduling) that uses a time slice of $$50$$ milliseconds. The time in milliseconds at which process $$C$$ would complete its first $${\rm I}/O$$ operation is __________.
int func(int num)
{
int count = 0;
while(num)
{
count++;
num >>= 1;
}
return (count);
}
The value returned by func(435) is _________.
double f (double x) {
if ( abs (x * x – 3) < 0. 01) return x;
else return f (x / 2 + 1.5/x);
}
Give a value q (to 2 decimals) such that f(q) will return q:______.int f(int j)
{
static int i = 50;
int k;
if (i == j)
{
printf("something");
k = f(i);
return 0;
}
else return 0;
}
Which one of the following is TRUE?Let $$L = \left\{ { < M > \left| M \right.} \right.$$ is a Turing machine that accepts a string of length $$\left. {2014} \right\}.$$ Then, $$L$$ is
$$\left. {\rm I} \right)$$ $$\,\,\,{L_{1 \bullet }}{L_2}$$ is a regular language
$$\left. {\rm II} \right)$$ $$\,\,\,{L_{1 \bullet }}{L_2} = \left\{ {{a^n}{b^n}\left| {n \ge \left. 0 \right\}} \right.} \right.$$
Which one of the following is CORRECT?