GATE 2015 (Session 1) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2015 (Session 1)

65 questions

MCQ 45 · NAT 201-mark 30 · 2-mark 35

Questions 46–50 of 65

Q46Intermediate Code Generation2 marksMCQ−0.67 if wrong
A variable x is said to be live at a statement SiS_{i} in a program if the following three conditions hold simultaneously:
i. There exists a statement SjS_{j} that uses x
ii. There is a path from SiS_{i} to SjS_{j} in the flow graph corresponding to the program
iii. The path has no intervening assignment to x including at SiS_{i} and SjS_{j}
p = q + rs = p + qu = s * v v = r + uq = s * uq = v + r 1234
The variables which are live both at the statement in basic block 2 and at the statement in basic block 3 of the above control flow graph are

Q47Intermediate Code Generation2 marksNAT
The least number of temporary variables required to create a three-address code in static single assignment form for the expression q + r / 3 + s - t * 5 + u * v /w is _______________.

Q48ER Model2 marksNAT
Consider an Entity-Relationship (ER) model in which entity sets E1 and E2 are connected by an m : n relationship R12. E1 and E3 are connected by a 1 : n (1 on the side of E1 and n on the side of E3) relationship R13.

E1 has two single-valued attributes a11 and a12 of which a11 is the key attribute. E2 has two single-valued attributes a21 and a22 of which a21 is the key attribute. E3 has two single-valued attributes a31 and a32 of which a31 is the key attribute. The relationships do not have any attributes.

If a relational model is derived from the above ER model, then the minimum number of relations that would be generated if all the relations are in 3NF is _______.

Q49Finite Automata2 marksNAT
M: N: b a b a a b a b
Consider the DFAs M and N given above. The number of states in a minimal DFA that accepts the language L(M)∩\cap L(N) is___________

Q50Push-down Automata2 marksMCQ−0.67 if wrong
Consider the NPDA ⟨Q={q0,q1,q2},\langle Q=\{q_{0},q_{1},q_{2}\}, Σ={0,1},\Sigma =\{0,1\}, Γ={0,1,⊥},δ,q0,⊥,\Gamma =\{0,1,\perp \},\delta ,q_{0},\perp , F={q2}⟩F=\{q_{2}\} \rangle, where (as per usual convention) Q is the set of states, Σ\Sigma is the input alphabet, Γ\Gamma is the stack alphabet, δ\delta is the state transition function, q0q_{0} is the initial state, ⊥\perp is the initial stack symbol, and FF is the set of accepting states. The state transition is as follows:
q0 q2 q3 1, Z → 1Z 0, Z → 0Z 0, 1Z → Z 1, 0Z → Z 0/1/ε, Z → Z ε, → ε
Which one of the following sequences must follow the string 101100 so that the overall string is accepted by the automaton?