Time Left - 10:00 mins
ISRO CS Quiz 9 : Compiler Design & Theory of Computation
Attempt now to get your rank among 560 students!
Question 1
Consider the following C code segment.
for (i – 0, i<n; i++) {
for (j=0; j<n; j++) {
if (i%2) {
x += (4*j + 5*i);
y += (7 + 4*j);
}
}
}
Which one of the following is false?
for (i – 0, i<n; i++) {
for (j=0; j<n; j++) {
if (i%2) {
x += (4*j + 5*i);
y += (7 + 4*j);
}
}
}
Which one of the following is false?
Question 2
Consider the basic block given below.
a = b + c
c = a + d
d = b + c
e = d – b
a = e + b
The minimum number of nodes and edges present in the DAG representation of the above basic block respectively are
a = b + c
c = a + d
d = b + c
e = d – b
a = e + b
The minimum number of nodes and edges present in the DAG representation of the above basic block respectively are
Question 3
Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?
Question 4
Type checking is normally done during ___
Question 5
Consider the grammar
S → (S) | a
Let the number of states in SLR (1), LR (1) and LALR (1) parsers for the grammar be n1, n2 and n3 respectively. The following relationship holds good
S → (S) | a
Let the number of states in SLR (1), LR (1) and LALR (1) parsers for the grammar be n1, n2 and n3 respectively. The following relationship holds good
Question 6
Which of the following statement is correct?
Question 7
Consider the following languages.
L1={0p 1q 0r | p, q, r > 0}
L2={0p 1q 0r | p, q, r > 0, p ≠ r }
Which one of the following statements is FALSE?
L1={0p 1q 0r | p, q, r > 0}
L2={0p 1q 0r | p, q, r > 0, p ≠ r }
Which one of the following statements is FALSE?
Question 8
Consider the NFA M shown below.
Let the language accepted by M be L. Let L1 be the language accepted by the NFA M1 obtained by changing the accepting state of M to a non-accepting state and by changing the non-accepting states of M to accepting states. Which of the following statements is true?
Let the language accepted by M be L. Let L1 be the language accepted by the NFA M1 obtained by changing the accepting state of M to a non-accepting state and by changing the non-accepting states of M to accepting states. Which of the following statements is true?
Question 9
Given the following state table of an FSM with two states A and B, one input and one output:
If the initial state is A = 0, B = 0, what is the minimum length of an input string which will take the machine to the state A= 0, B = 1 with Output = 1?
If the initial state is A = 0, B = 0, what is the minimum length of an input string which will take the machine to the state A= 0, B = 1 with Output = 1?
Question 10
If s is a string over (0 + 1)* then let n0(s) denote the number of 0’s in s and n1(s) the number of 1’s in s.
Which one of the following languages is not regular?
- 560 attempts
- 1 upvote
- 22 comments
Jun 29GATE & PSU CS