Computer Science and Information Technology
2024 · Paper 1
Take it one question at a time. Try an answer, then check your understanding.
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.
Question 40
Open questionCS1MCQ2 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 answerQuestion 41
Open questionCS1MCQ2 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 answerQuestion 42
Open questionCS1MCQ2 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