Computer Science and Information Technology
2023 · Paper 1
Take it one question at a time. Try an answer, then check your understanding.
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.
Question 37
Open questionCSMCQ2 marksNeeds review
Consider the control flow graph shown.

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 answerQuestion 38
Open questionCSMCQ2 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 answerQuestion 39
Open questionCSMCQ2 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