Computer Science and Information Technology
GATE CSE year:2017 PYQs
Build your understanding with focused practice from past exam papers.
Questions 81–90 of 130. Imported answers require independent review unless marked reviewed.
Question 41
Open questionCSMCQ2 marksNeeds review
Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId), and DEPT(DeptName, DeptId). Note that the DeptId can be permitted to be NULL in the relation EMP. Consider the following queries on the database expressed in tuple relational calculus.
(I)
(II)
(III)
Which of the above queries are safe?
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 41
Open questionCSMCQ2 marksNeeds review
Let L(R) be the language represented by regular expression R. Let L(G) be the language generated by a context free grammar G. Let L(M) be the language accepted by a Turing machine M. Which of the following decision problems are undecidable?
I. Given a regular expression R and a string w, is w ∈ L(R)?
II. Given a context-free grammar G, is L(G) = ∅?
III. Given a context-free grammar G, is L(G) = Σ* for some alphabet Σ?
IV. Given a Turing machine M and a string w, is w ∈ L(M)?
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 42
Open questionCSMCQ2 marksNeeds review
In a database system, unique timestamps are assigned to each transaction using Lamport’s logical clock. Let
and
be the timestamps of transactions
and
respectively. Besides,
holds a lock on the resource R, and
has requested a conflicting lock on the same resource R. The following algorithm is used to prevent deadlocks in the database system assuming that a killed transaction is restarted with the same timestamp.if
then
is killedelse
waits.Assume any transaction that is not killed terminates eventually. Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks?
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 42
Open questionCSMCQ2 marksNeeds review
The next state table of a 2-bit saturating up-counter is given below.
Q₁ | Q₀ | Q₁⁺ | Q₀⁺ |
|---|---|---|---|
0 | 0 | 0 | 1 |
0 | 1 | 1 | 0 |
1 | 0 | 1 | 1 |
1 | 1 | 1 | 1 |
The counter is built as a synchronous sequential circuit using T flip-flops. The expressions for T₁ and T₀ are
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 43
Open questionCSNAT2 marksNeeds review
Consider the following grammar:
stmt
if expr then expr else expr; stmt
òexpr
term relop term
termterm
id
numberid
a
b
cnumber
[0-9]where relop is a relational operator (e.g.,<, >, …), ò refers to the empty statement, and if, then, else are terminals.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 43
Open questionCSNAT2 marksNeeds review
Consider the following snippet of a C program. Assume that swap(&x, &y) exchanges the contents of x and y.
int main() {
int array[] = {3, 5, 1, 4, 6, 2};
int done = 0;
int i;
while (done == 0) {
done = 1;
for (i=0; i<=4; i++) {
if (array[i] < array[i+1]) {
swap(&array[i], &array[i+1]);
done = 0;
}
}
for (i=5; i>=1; i--) {
if (array[i] > array[i-1]) {
swap(&array[i], &array[i-1]);
done = 0;
}
}
}
printf("%d", array[3]);
}
The output of the program is __________.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 44
Open questionCSNAT2 marksNeeds review
In a RSA cryptosystem, a participant A uses two prime numbers
and
to generate her public and private keys. If the public key of A is 35, then the private key of A is __________.Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 44
Open questionCSNAT2 marksNeeds review
Two transactions
and
are given as
where
denotes a read operation by transaction
on a variable
and
denotes a write operation by transaction
on a variable
. The total number of conflict serializable schedules that can be formed by
and
is __________.Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 45
Open questionCSNAT2 marksNeeds review
The values of parameters for the Stop-and-Wait ARQ protocol are as given below:
Bit rate of the transmission channel = 1 Mbps.
Propagation delay from sender to receiver = 0.75 ms.
Time to process a frame = 0.25 ms.
Number of bytes in the information frame = 1980.
Number of bytes in the acknowledge frame = 20.
Number of overhead bytes in the information frame = 20.
Assume that there are no transmission errors. Then, the transmission efficiency (expressed in percentage) of the Stop-and-Wait ARQ protocol for the above parameters is __________ (correct to 2 decimal places).
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 45
Open questionCSNAT2 marksNeeds review
The read access times and the hit ratios for different caches in a memory hierarchy are as given below.
Cache | Read access time (in nanoseconds) | Hit ratio |
|---|---|---|
I-cache | 2 | 0.8 |
D-cache | 2 | 0.9 |
L2-cache | 8 | 0.9 |
The read access time of main memory is 90 nanoseconds. Assume that the caches use the referred-word-first read policy and the write back policy. Assume that all the caches are direct mapped caches. Assume that the dirty bit is always 0 for all the blocks in the caches. In execution of a program, 60% of memory reads are for instruction fetch and 40% are for memory operand fetch. The average read access time in nanoseconds (up to 2 decimal places) is __________.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer