# Recent questions tagged gate2015-3 1
Consider the following software items: Program-$X$, Control Flow Diagram of Program-$Y$ and Control Flow Diagram of Program-$Z$ as shown below The values of McCabe's Cyclomatic complexity of program-$X$, program-$Y$, and program-$Z$ respectively are 4, 4, 7 3, 4, 7 4, 4, 8 4, 3, 8
2
Consider the following C program: #include<stdio.h> int f1(void); int f2(void); int f3(void); int x=10; int main() { int x=1; x += f1() + f2 () + f3() + f2(); printf("%d", x); return 0; } int f1() { int x = 25; x++; return x;} int f2() { static int x = 50; x++; return x;} int f3() { x *= 10; return x;} The output of the program is ______.
3
Language $L_1$ is polynomial time reducible to language $L_2$. Language $L_3$ is polynomial time reducible to language $L_2$, which in turn polynomial time reducible to language $L_4$. Which of the following is/are true? $\text{ if } L_4 \in P, \text{ then } L_2 \in P$ ... $\text{ if } L_4 \in P, \text{ then } L_3 \in P$ II only III only I and IV only I only
4
Consider the following policies for preventing deadlock in a system with mutually exclusive resources. Process should acquire all their resources at the beginning of execution. If any resource is not available, all resources acquired so far are released. The resources are numbered uniquely, and processes are allowed to ... of (II) and (III) but not (I) or (IV) Any one of (I), (II), (III) and (IV)
5
Consider the following reservation table for a pipeline having three stages $S_1, S_2 \text{ and } S_3$. $\begin{array}{|ccccc|} \hline \textbf{Time} \rightarrow \\\hline & \text{1}& \text{2} & \text{$3$} & \text{$4$} & \text{$5$} \\\hline \textbf{$S _1$} & \text{$ ... $}\\\hline \textbf{$S _3$} & & & \text{$X$} & \\\hline \end{array}$ The minimum average latency (MAL) is ______
6
The velocity $v$ (in kilometer/minute) of a motorbike which starts form rest, is given at fixed intervals of time $t$ (in minutes) as follows: t 2 4 6 8 10 12 14 16 18 20 v 10 18 25 29 32 20 11 5 2 0 The approximate distance (in kilometers) rounded to two places of decimals covered in 20 minutes using Simpson's $1/3^{rd}$ rule is ________.
7
Suppose $c = \langle c, \dots, c[k-1]\rangle$ is an array of length $k$, where all the entries are from the set $\{0, 1\}$. For any positive integers $a \text{ and } n$, consider the following pseudocode. DOSOMETHING (c, a, n) $z \leftarrow 1$ ... , then the output of DOSOMETHING(c, a, n) is _______.
8
Consider the following C program: #include<stdio.h> int main() { int i, j, k = 0; j=2 * 3 / 4 + 2.0 / 5 + 8 / 5; k-=--j; for (i=0; i<5; i++) { switch(i+k) { case 1: case 2: printf("\n%d", i+k); case 3: printf("\n%d", i+k); default: printf("\n%d", i+k); } } return 0; } The number of times printf statement is executed is _______.
9
Consider the following code sequence having five instructions from $I_1 \text{ to } I_5$. Each of these instructions has the following format. OP Ri, Rj, Rk Where operation OP is performed on contents of registers Rj and Rk and the result is stored in register Ri. $I_1$: ADD ... of the above statements is/are correct? Only S1 is true Only S2 is true Only S1 and S3 are true Only S2 and S3 are true
10
Consider a B+ tree in which the search key is $12$ $\text{byte}$ long, block size is $1024$ $\text{byte}$, recorder pointer is $10$ $\text{byte}$ long and the block pointer is $8$ $\text{byte}$ long. The maximum number of keys that can be accommodated in each non-leaf node of the tree is ______.
11
If for non-zero $x, \: af(x) + bf(\frac{1}{x}) = \frac{1}{x} - 25$ where a $a \neq b \text{ then } \int_1^2 f(x)dx$ is $\frac{1}{a^2 - b^2} \begin{bmatrix} a(\ln 2 - 25) + \frac{47b}{2} \end{bmatrix}$ ... $\frac{1}{a^2 - b^2} \begin{bmatrix} a(\ln 2 - 25) - \frac{47b}{2} \end{bmatrix}$
12
Given the function $F = P' +QR$, where $F$ is a function in three Boolean variables $P, Q$ and $R$ and $P'=!P$, consider the following statements. $(S1) F = \sum(4, 5, 6)$ $(S2) F = \sum(0, 1, 2, 3, 7)$ $(S3) F = \Pi (4, 5, 6)$ ... )-False (S1)-True, (S2)-False, (S3)-False, (S4)-True (S1)-False, (S2)-False, (S3)-True, (S4)-True (S1)-True, (S2)-True, (S3)-False, (S4)-False
13
The total number of prime implicants of the function $f(w, x, y, z) = \sum (0, 2, 4, 5, 6, 10)$ is __________
14
Let $f(n) = n$ and $g(n) = n^{(1 + \sin \: n)}$, where $n$ is a positive integer. Which of the following statements is/are correct? $f(n) = O(g(n))$ $f(n) = \Omega(g(n))$ Only I Only II Both I and II Neither I nor II
15
Let $R$ be a relation on the set of ordered pairs of positive integers such that $((p,q),(r,s)) \in R$ if and only if $p-s=q-r$. Which one of the following is true about R? Both reflexive and symmetric Reflexive but not symmetric Not reflexive but symmetric Neither reflexive nor symmetric
16
Let $G$ be a connected undirected graph of $100$ vertices and $300$ edges. The weight of a minimum spanning tree of $G$ is $500$. When the weight of each edge of $G$ is increased by five, the weight of a minimum spanning tree becomes ______.
17
Consider the following recursive C function. void get(int n) { if (n<1) return; get (n-1); get (n-3); printf("%d", n); } If $get(6)$ function is being called in $main()$ then how many times will the $get()$ function be invoked before returning to the $main()$? $15$ $25$ $35$ $45$
18
In the network $200.10.11.144/27$, the $fourth$ octet (in decimal) of the last $IP$ address of the network which can be assigned to a host is _____.
19
Suppose $X_i$ for $i=1, 2, 3$ are independent and identically distributed random variables whose probability mass functions are $Pr[X_i = 0] = Pr[X_i = 1] = \frac{1} {2} \text{ for } i = 1, 2, 3$. Define another random variable $Y = X_1X_2 \oplus X_3$, where $\oplus$ denotes XOR. Then $Pr[Y=0 \mid X_3 = 0] =$______.
20
Two hosts are connected via a packet switch with $10^7$ bits per second links. Each link has a propagation delay of $20$ microseconds. The switch begins forwarding a packet $35$ microseconds after it receives the same. If $10000$ bits of data are to be ... time elapsed between the transmission of the first bit of data and the reception of the last bit of the data in microseconds is ______.
21
Consider the equation $(43)_x = (y3)_8$ where $x$ and $y$ are unknown. The number of possible solutions is _____
22
For the processes listed in the following table, which of the following scheduling schemes will give the lowest average turnaround time? ... First Come First Serve Non-preemptive Shortest job first Shortest Remaining Time Round Robin with Quantum value two
23
If the following system has non-trivial solution, $px + qy + rz = 0$ $qx + ry + pz = 0$ $rx + py + qz = 0$, then which one of the following options is TRUE? $p - q + r = 0 \text{ or } p = q = -r$ $p + q - r = 0 \text{ or } p = -q = r$ $p + q + r = 0 \text{ or } p = q = r$ $p - q + r = 0 \text{ or } p = -q = -r$
24
Which of the following languages are context-free? $L_1: \left\{a^mb^na^nb^m \mid m, n \geq 1\right\}$ $L_2: \left\{a^mb^na^mb^n \mid m, n \geq 1\right\}$ $L_3: \left\{a^mb^n \mid m = 2n +1 \right\}$ $L_1$ and $L_2$ only $L_1$ and $L_3$ only $L_2$ and $L_3$ only $L_3$ only
25
Consider the following grammar G $S \rightarrow F \mid H$ $F \rightarrow p \mid c$ $H \rightarrow d \mid c$ Where $S$, $F$, and $H$ are non-terminal symbols, $p, d$, and $c$ are terminal symbols. Which of the following statement(s) is/are correct? S1 ... are generated using grammar G S2: LR(1) can parse all strings that are generated using grammar G Only S1 Only S2 Both S1 and S2 Neither S1 and S2
26
Consider the following two C code segments. $Y$ and $X$ are one and two dimensional arrays of size $n$ and $n \times n$ respectively, where $2 \leq n \leq 10$. Assume that in both code segments, elements of $Y$ ... in code segment 2 are contiguous in main memory Only S2 is correct Only S3 is correct Only S1 and S2 are correct Only S1 and S3 are correct
27
Consider the partial Schedule $S$ involving two transactions $T1$ and $T2$. Only the $\textit{read}$ and the $\textit{write}$ operations have been shown. The $\textit{read}$ operation on data item $P$ is denoted by $\textit{read(P)}$ and ... aborted and then re-started to ensure transaction atomicity Schedule $S$ is recoverable and can ensure transaction atomicity and nothing else needs to be done
Consider a network connecting two systems located $8000$ $\text{Km}$ apart. The bandwidth of the network is $500 \times 10^6$ $\text{bits}$ per second. The propagation speed of the media is $4 \times 10^6$ $\text{meters}$ per second. It needs to ... full capacity. Assume that processing delays at nodes are negligible. Then, the minimum size in bits of the sequence number field has to be ______.
Assume that a mergesort algorithm in the worst case takes $30$ seconds for an input of size $64$. Which of the following most closely approximates the maximum input size of a problem that can be solved in $6$ minutes? $256$ $512$ $1024$ $2018$