Computer Science and Information Technology
GATE CSE exam:gate PYQs
Build your understanding with focused practice from past exam papers.
Questions 911–920 of 975. Imported answers require independent review unless marked reviewed.
Question 33
Open questionCSMCQ2 marksNeeds review
A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for three processes are shown below:
Process | Current Allocation | Maximum Requirement |
|---|---|---|
P1 | 3 | 7 |
P2 | 1 | 6 |
P3 | 3 | 5 |
Which of the following best describes current state of the system?
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 34
Open questionCSMCQ2 marksNeeds review
If
is a grammar with productions
where
is the start variable, then which one of the following strings is not generated by
?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 34
Open questionCSMCQ2 marksNeeds review
Consider a binary code that consists of only four valid codewords as given below:
00000, 01011, 10101, 11110
Let the minimum Hamming distance of the code be
and the maximum number of erroneous bits that can be corrected by the code be
. Then the values of
and
areYour 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 35
Open questionCSMCQ2 marksNeeds review
Consider the following two functions.
void fun1(int n) {
if(n == 0) return;
printf("%d", n);
fun2(n - 2);
printf("%d", n);
}
void fun2(int n) {
if(n == 0) return;
printf("%d", n);
fun1(++n);
printf("%d", n);
}
The output printed when fun1(5) is called is
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 35
Open questionCSMCQ2 marksNeeds review
Consider two hosts
and
, connected by a single direct link of rate
bits/sec. The distance between the two hosts is 10,000 km and the propagation speed along the link is
m/sec. Host
sends a file of 50,000 bytes as one large message to host
continuously. Let the transmission and propagation delays be
milliseconds and
milliseconds, respectively. Then the values of
and
areYour 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 36
Open questionCSMCQ2 marksNeeds review
Consider the C functions foo and bar given below:
int foo(int val) {
int x = 0;
while(val > 0) {
x = x + foo(val--);
}
return val;
}
int bar(int val) {
int x = 0;
while(val > 0) {
x = x + bar(val-1);
}
return val;
}
Invocations of foo(3) and bar(3) will result in:
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 36
Open questionCSMCQ2 marksNeeds review
The pre-order traversal of a binary search tree is given by 12, 8, 6, 2, 7, 9, 10, 16, 15, 19, 17, 20. Then the post-order traversal of this tree is:
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 37
Open questionCSMCQ2 marksNeeds review
Consider the context-free grammars over the alphabet
given below.
and
are non-terminals.
The language
isYour 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 37
Open questionCSMCQ2 marksNeeds review
Consider the C program fragment below which is meant to divide x by y using repeated subtractions. The variables x, y, q and r are all unsigned int.
while (r >= y) {
r = r - y;
q = q + 1;
}
Which of the following conditions on the variables x, y, q and r before the execution of the fragment will ensure that the loop terminates in a state satisfying the condition x == (y*q + r)?
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 38
Open questionCSMCQ2 marksNeeds review
Consider the following languages over the alphabet
. Let
and
.Which of the following are context-free languages?
I.
II.
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 answer