Complete GATE CSE 2023 Paper 1 overview, original pages and practice · Timed previous-paper practice

Questions 37–39 of 65. Imported answers require review unless explicitly marked reviewed.

Paper practice 65 questionsPage 13 of 22

Question 37

Open question
CSMCQ2 marksNeeds review
Consider the control flow graph shown.
Diagram for Computer Science and Information Technology question 37

Which one of the following choices correctly lists the set of live variables at the exit point of each basic block?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 38

Open question
CSMCQ2 marksNeeds review
Consider the two functions inc and dec shown below.
inc(){ dec(){
wait(s); wait(s);
X = X+1; X = X-1;
signal(s); signal(s);
} }
There are 5 threads each invoking inc once, and 3 threads each invoking dec once, on the same shared variable X. The initial value of X is 10.
Suppose there are two implementations of the semaphore s, as follows:
I-1: s is a binary semaphore initialized to 1.
I-2: s is a counting semaphore initialized to 2.
Let V1, V2 be the values of X at the end of execution of all the threads with implementations I-1, I-2, respectively.
Which one of the following choices corresponds to the minimum possible values of V1, V2, respectively?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 39

Open question
CSMCQ2 marksNeeds review
Consider the context-free grammar

below

where

and

are non-terminals, and

and

are terminal symbols. The starting non-terminal is

.
Which one of the following statements is CORRECT?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer