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

GATE 2020

64 questions

MCQ 41 · NAT 231-mark 29 · 2-mark 35

Questions 41–45 of 64

Q42Context Free Language2 marksMCQ−0.67 if wrong
Consider the following languages.
L1={wxyx∣w,x,y∈(0+1)+}L_1=\{wxyx|w,x,y \in (0+1)^+\}
L2={xy∣x,y∈(a+b)∗,∣x∣=∣y∣,x≠y}L_2=\{xy|x,y \in (a+b)^*,|x|=|y|,x\neq y\}

Which one of the following is TRUE?

Q43Intermediate Code Generation2 marksMCQ−0.67 if wrong
Consider the productions A→PQA\rightarrow PQ and A→XYA\rightarrow XY. Each of the five non-terminals A,P,Q,X, and Y has two attributes: s is a synthesized attribute, and i is an inherited attribute. Consider the following rules.

Rule 1: P.i=A.i+2, Q.i=P.i+A.i, and A.s=P.s+Q.s
Rule 2: X.i=A.i+Y.s and Y.i=X.s+A.i

Which one of the following is TRUE?

Q44Process Synchronization2 marksMCQ−0.67 if wrong
Each of a set of n processes executes the following code using two semaphores a and b initialized to 1 and 0, respectively. Assume that count is a shared variable initialized to 0 and not used in CODE SECTION P.
CODE SECTION P

wait(a); count=count+1;
if (count==n) signal(b);
signal(a); wait(b); signal(b);

CODE SECTION Q

What does the code achieve?

Q45Disk Scheduling2 marksMCQ−0.67 if wrong
Consider the following five disk access requests of the form (request id, cylinder number) that are present in the disk scheduler queue at a given time.

(P,155),(Q,85),(R,110),(S,30),(T,115)

Assume the head is positioned at cylinder 100. The scheduler follows Shortest Seek Time First scheduling to service the requests.

Which one of the following statements is FALSE?

Q46Normal Form2 marksMCQ−0.67 if wrong
Consider a relational table R that is in 3NF, but not in BCNF. Which one of the following statements is TRUE?