S1 : if a candidate is known to be corrupt, then he will not be elected
S2 : if a candidate is kind, he will be elected
Which one of the following statements follows from S1 and S2 per sound interference rules of
logic?
Answer : Option CExplaination / Solution:
Let P: candidate known to be corrupt
q: candidate will be elected
r: candidate is kind
S1 = p ⟶ ~ q
= q ⟶~p
S2 = r ⟶ q
i.e., If a person is kind, he is not known to be corrupt
Option is C
Answer : Option CExplaination / Solution:
Lemical Analyzer uses DFA to recognize the longest possible input sequence that makes up a
token. Parser takes input in the form of tokens and usually builds a data structure in the form
of parse tree. Here parse tree can be termed as a Production tree as parser uses production of
the grammar to check whether generated tokens form a meaningful compression).
Register allocation can be reduced to K-colouring problem where K is the number of registers
available on the target architecture.
Post order traversal of expression tree gives postfix notation for a given expression & this
post fix notation can be evaluated using stack.
Q5.Consider the alphabet ∑ = {0.1},
the null/empty string λ and the sets of strings
X0 , X1 , and
X2 generated by the corresponding non-terminals of regular grammar. X0, X1, and X2 are
related as follows:
X0 = 1X1
X1 = 0X1 + 1X2
X2 = 0X1 + {λ}
Which one of the following choices precisely represents the strings in X0?
Answer : Option CExplaination / Solution: No Explaination.
Q8.Let R be the relation on the set of positive integers such that a aRb if and only if a and b are
distinct and have a common divisor other than 1. Which one of the following statements
about R is true?
Answer : Option DExplaination / Solution:
R is not reflexive as each element can‟t be related to itself.
R is symmetric
Let a = 3, b = 6 and c = 10 then 3 and 6 have a common division other than 1
Q9. In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the
following is TRUE?
Answer : Option CExplaination / Solution:
Optional (A) is not true when CFG contains cycle
Option (B) is false as CFG can contain cycle
Option (D) is false as a single node can contain block of statements.
Q10.Consider two decision problems Q1, Q2 such that Q1 reduces in polynomial time to 3-SAT
and 3 -SAT reduces in polynomial time to Q2. Then which one of following is consistent with
the above statement?
Answer : Option AExplaination / Solution:
Total Question/Mark :
Scored Mark :
Mark for Correct Answer : 1
Mark for Wrong Answer : -0.5
Mark for Left Answer : 0