Q1. Consider the program given below, in a block-structured pseudo-language with lexical
scoping and nesting of procedures permitted
Program main;
Var . . .
Procedure A1;
Var ….
Call A2;
End A1
Procedure A2;
Var . . .
Procedure A21;
Var . . .
Call A1;
End A21
Call A21;
End A2
Call A1;
End main.
Consider the calling chain: Main → A1 → A2 → A21 → A1
The correct set of activation records along with their access links is given by
Answer : Option DExplaination / Solution:
Access link is defined as link to activation record of closest lexically enclosing block in
program text, so the closest enclosing blocks respectively for A1 ,A2 and A21 are main ,
main and A2
Q2.One of the header fields in an IP datagram is the Time to Live (TTL) field. Which
of the following statements best explains the need for this field?
Answer : Option BExplaination / Solution: No Explaination.
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.Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n
elements. Assume that the insertion and deletion operations are carried out using REAR and
FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions
to detect queue full and queue empty are
Answer : Option AExplaination / Solution:
The counter example for the condition full : REAR = FRONT is
Initially when the Queue is empty REAR=FRONT=0 by which the above full condition is satisfied which is false
The counter example for the condition full : (FRONT+1)mod n =REAR is
Initially when the Queue is empty REAR=FRONT=0 and let n=3, so after inserting one element REAR=1 and FRONT=0, at this point the condition full above is satisfied, but still there is place for one more element in Queue, so this condition is also false
The counter example for the condition empty : (REAR+1)mod n = FRONT is
Initially when the Queue is empty REAR=FRONT=0 and let n=2, so after inserting one element REAR=1 and FRONT=0, at this point the condition empty above is satisfied, but the queue of capacity n-1 is full here
The counter example for the condition empty : (FRONT+1)mod n =REAR is
Initially when the Queue is empty REAR=FRONT=0 and let n=2, so after inserting one element REAR=1 and FRONT=0, at this point the condition empty above is satisfied, but the queue of capacity n-1 is full here
Q7.Consider the methods used by processes P1 and P2 for accessing their critical
sections whenever needed, as given below. The initial values of shared boolean
variables S1 and S2 are randomly assigned.
Which one of the following statements describes the properties achieved?
Answer : Option BExplaination / Solution: No Explaination.
Q10.Let G be a weighted graph with edge weights greater than one and G’ be the graph
constructed by squaring the weights of edges in G. Let T and T’ be the minimum spanning
trees of G and G’ respectively, with total weights t and t’. Which of the following statements
is TRUE?
Answer : Option DExplaination / Solution:
Graph G is counter example for options (B) and (C) and Graph G1 is counter example for
option (A)
Total Question/Mark :
Scored Mark :
Mark for Correct Answer : 1
Mark for Wrong Answer : -0.5
Mark for Left Answer : 0