GATE 2009 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2009

66 questions

MCQ 661-mark 24 · 2-mark 42

Questions 46–50 of 66

Q46Parsing2 marksMCQ−0.67 if wrong
Which of the following statements are TRUE?

I There exist parsing algorithms for some programming languages whose complexities are less than θ(n3)\theta (n^{3}).
II A programming language which allows recursion can be implemented with static storage allocation.
III No L-attributed definition can be evaluated in the framework of bottom-up parsing.
IV Code improving transformations can be performed at both source language and intermediate code level.

Q47Matching1 markMCQ−0.33 if wrong
Match all items in Group 1 with correct options from those given in Group 2.
Group 1 Group 2 P.Regular expression1.Syntax analysis Q.Pushdown automata2.Code generation R.Dataflow analysis3.Lexical analysis S.Register allocation4.Code optimization

Q48Process2 marksMCQ−0.67 if wrong
In the following process state transition diagram for a uniprocessor system, assume that there are always some processes in the ready state:
Start Ready Running Terminated Blocked A B C D E F
Now consider the following statements:

I. If a process makes a transition D, it would result in another process making transition A immediately.
II. A process P2 in blocked state can make transition E while another process P1 is in running state.
III. The OS uses preemptive scheduling.
IV. The OS uses non-preemptive scheduling.

Which of the above statements are TRUE?

Q49Process Synchronization2 marksMCQ−0.67 if wrong
The enter_CS() and leave_CS() functions to implement critical section of a process are realized using test-and-set instruction as follows:
 void enter_CS(x)
{
                while test-and-set(x) ;
}
void leave_CS(x)
{
              x=0;
} 
In the above solution, x is a memory location associated with the CS and is nitialized to 0.
Now consider the following statements:

I. The above solution to CS problem is deadlock-free
II. The solution is starvation free.
III. The processes enter CS in FIFO order.
IV More than one process can enter CS at the same time.

Which of the above statements is TRUE?

Q50Deadlock2 marksMCQ−0.67 if wrong
Consider a system with 4 types of resources R1 (3 units), R2 (2 units), R3 (3 units), R4 (2 units). A non-preemptive resource allocation policy is used. At any given instance, a request is not entertained if it cannot be completely satisfied. Three processes P1, P2, P3 request the sources as follows if executed independently.
Process P1: t=0: requests 2 units of R2 t=1: requests 1 unit of R3 t=3: requests 2 units of R1 t=5: releases 1 unit of R2 and 1 unit of R1. t=7: releases 1 unit of R3 t=8: requests 2 units of R4 t=10: Finishes Process P2: t=0: requests 2 units of R3 t=2: requests 1 unit of R4 t=4: requests 1 unit of R1 t=6: releases 1 unit of R3 t=8: Finishes Process P3: t=0: requests 1 unit of R4 t=2: requests 2 units of R1 t=5: releases 2 units of R1 t=7: requests 1 unit of R2 t=8: requests 1 unit of R3 t=9: Finishes
Which one of the following statements is TRUE if all three processes run concurrently starting at time t=0?