GATE 2015 (Session 3)
65 questions
MCQ 45 · NAT 201-mark 30 · 2-mark 35
Questions 51–55 of 65
Consider the following partial Schedule S involving two transactions T1 and T2. Only the read and the write operations have been shown. The read operation on data item P is denoted by read(P) and the write operation on data item P is denoted by write(P).
Suppose that the transaction T1 fails immediately after time instance 9. Which one of the following statements is correct?
Suppose that the transaction T1 fails immediately after time instance 9. Which one of the following statements is correct?
Answer: (B)
T1 writes A at time 2. T2 then reads that value of A at time 7. T2 commits at time 8, and this is before T1 commits.
T1 fails after that. T2 has already committed after using a value of A that must be rolled back. T2's effects cannot be undone, so S is non-recoverable.
Answer: Schedule S is non-recoverable and cannot ensure transaction atomicity
T1 fails after that. T2 has already committed after using a value of A that must be rolled back. T2's effects cannot be undone, so S is non-recoverable.
Answer: Schedule S is non-recoverable and cannot ensure transaction atomicity
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?
px+qy+rz=0
qx+ry+pz=0
rx+py+qz=0,
then which one of the following options is TRUE?
Answer: (C)
For a non-trivial solution, the determinant must be zero:
The second factor equals . It becomes zero only when p = q = r.
Answer: p + q + r = 0 or p = q = r
The second factor equals . It becomes zero only when p = q = r.
Answer: p + q + r = 0 or p = q = r
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 ________.Answer: 10
Find j: 2*3/4 + 2.0/5 + 8/5 = 1 + 0.4 + 1 = 2.4 j = 2. After --j, j = 1, so k = 1.
The values of i + k are 1, 0, 1, 2, 3. There is no break, so the cases fall through:
- 1, 0: only default runs 1 + 1
- 1, 2: case 2, case 3, default 3 + 3
- 3: case 3, default 2
Total = 10
Answer: 10
The values of i + k are 1, 0, 1, 2, 3. There is no break, so the cases fall through:
- 1, 0: only default runs 1 + 1
- 1, 2: case 2, case 3, default 3 + 3
- 3: case 3, default 2
Total = 10
Answer: 10
If for non-zero where then is
Answer: (A)
Put 1/x in place of x: . Now remove f(1/x) from the two equations:
Result of elimination:
Now integrate from 1 to 2:
Answer:
Result of elimination:
Now integrate from 1 to 2:
Answer:
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 ________.
Answer: 995
A spanning tree of this graph always has 99 edges. So when each edge gets 5 more, the weight of every spanning tree goes up by 99 5 = 495. The tree that was minimum before is still the minimum.
New weight: 500 + 495 = 995
Answer: 995
New weight: 500 + 495 = 995
Answer: 995