Computer Science and Information Technology
GATE CSE topic:computing PYQs
Build your understanding with focused practice from past exam papers.
Questions 591–600 of 975. Imported answers require independent review unless marked reviewed.
Question 26
Open questionCSMCQ2 marksNeeds review
Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation (SDT) actions, given as pseudo-code:
With respect to the above grammar, which one of the following choices is correct?
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 26
Open questionCSMCQ2 marksNeeds review
Consider the string abccdeee. Each letter in the string must be assigned a binary code satisfying the following properties:
For any two letters, the code assigned to one letter must not be a prefix of the code assigned to the other letter.
For any two letters of the same frequency, the letter which occurs earlier in the dictionary order is assigned a code whose length is at most the length of the code assigned to the other letter.
Among the set of all binary code assignments which satisfy the above two properties, what is the minimum length of the encoded string?
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 27
Open questionCSMCQ2 marksNeeds review
The following relation records the age of 500 employees of a company, where
(indicating the employee number) is the key:
Consider the following relational algebra expression:
What does the above expression generate?
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 27
Open questionCSMCQ2 marksNeeds review
Assume a two-level inclusive cache hierarchy, L1 and L2, where L2 is the larger of the two. Consider the following statements.
: Read misses in a write through L1 cache do not result in writebacks of dirty lines to the L2.
: Write allocate policy must be used in conjunction with write through caches and no-write allocate policy is used with writeback caches.Which of the following statements is correct?
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 28
Open questionCSMCQ2 marksNeeds review
Consider a 3-bit counter, designed using T flip-flops, as shown below:

Assuming the initial state of the counter given by
as 000, what are the next three states?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 28
Open questionCSMCQ2 marksNeeds review
Suppose we want to design a synchronous circuit that processes a string of 0’s and 1’s. Given a string, it produces another string by replacing the first 1 in any subsequence of consecutive 1’s by a 0. Consider the following example.
Input sequence: 00100110001100
Output sequence: 000000100001100
A Mealy Machine is a state machine where both the next state and the output are functions of the present state and the current input. The mentioned circuit can be designed as a two-state Mealy machine. The states in the Mealy machine can be represented using Boolean values 0 and 1. We denote the current state, the next state, the next incoming bit, and the output bit of the Mealy machine by the variables
,
,
and
respectively. Assume the initial state of the Mealy machine is 0.What are the Boolean expressions corresponding to
and
in terms of
and
?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 29
Open questionCSMCQ2 marksNeeds review
Assume that a 12-bit Hamming codeword consisting of 8-bit data and 4 check bits is
, where the data bits and the check bits are given in the following tables:Data bits:
.Check bits:
.Which one of the following choices gives the correct values of
and
?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 29
Open questionCSMCQ2 marksNeeds review
In an examination, a student can choose the order in which two questions (QuesA and QuesB) must be attempted.
If the first question is answered wrong, the student gets zero marks.
If the first question is answered correctly and the second question is not answered correctly, the student gets the marks only for the first question.
If both the questions are answered correctly, the student gets the sum of the marks of the two questions.
The following table shows the probability of correctly answering a question and the marks of the question respectively.
question | probability of answering correctly | marks |
|---|---|---|
QuesA | 0.8 | 10 |
QuesB | 0.5 | 20 |
Assuming that the student always wants to maximize her expected marks in the examination, in which order should she attempt the questions and what is the expected marks for that order (assume that the questions are independent)?
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 30
Open questionCSMCQ2 marksNeeds review
Consider the following recurrence relation.
Which one of the following options is correct?
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 30
Open questionCSMCQ2 marksNeeds review
Consider the following ANSI C code segment:
z = x + 3 + y->f1 + y->f2;
for (i = 0; i < 200; i = i + 2){
if (z > i) {
p = p + x + 3;
q = q + y->f1;
} else {
p = p + y->f2;
q = q + x + 3;
}
}
Assume that the variable y points to a struct (allocated on the heap) containing two fields f1 and f2, and the local variables x, y, z, p, q, and i are allocated in registers. Common sub-expression elimination (CSE) optimization is applied on the code. The number of addition and dereference operations (of the form y->f1 or y->f2) in the optimized code, respectively, 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 answer