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

Questions 40–42 of 65. Imported answers require review unless explicitly marked reviewed.

Paper practice 65 questionsPage 14 of 22

Question 40

Open question
CS1MCQ2 marksNeeds review
Consider the following two threads T1 and T2 that update two shared variables a and b. Assume that initially a = b = 1. Though context switching between threads can happen at any time, each statement of T1 or T2 is executed atomically.
T1: a = a + 1; b = b + 1;
T2: b = 2 * b; a = 2 * a;
Which one of the following options lists all the possible combinations of values of a and b after both T1 and T2 finish execution?
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 41

Open question
CS1MCQ2 marksNeeds review
An array [82, 101, 90, 11, 111, 75, 33, 131, 44, 93] is heapified. Which one of the following options represents the first three elements in the heapified array?
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 42

Open question
CS1MCQ2 marksNeeds review
Consider the following recurrence relation:

Which one of the following options 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