Question 7812 – Algorithms
November 10, 2023Hadoop
November 10, 2023NTA UGC NET JUNE-2023 Paper-2
Question 6
|
At particular time of computation, the value of a counting semaphore is 7.Then 20p operations and ‘x’ V operations were completed on this semaphore.if the final value of semaphore is 5,x will be
15
|
|
22
|
|
18
|
|
13
|
Question 6 Explanation:
The final value of a counting semaphore after ‘p’ P (wait) operations and ‘v’ V (signal) operations can be calculated as follows:
Final Value = Initial Value + V – P
In this case, the initial value is 7, ‘p’ is 20, and ‘v’ is x. So,
Final Value = 7 + x – 20
Given that the final value is 5, we can set up the equation:
5 = 7 + x – 20
Now, solve for ‘x’:
x = 5 – 7 + 20
x = 18
So, the value of ‘x’ is 18.
Correct Answer: C
Question 6 Explanation:
The final value of a counting semaphore after ‘p’ P (wait) operations and ‘v’ V (signal) operations can be calculated as follows:
Final Value = Initial Value + V – P
In this case, the initial value is 7, ‘p’ is 20, and ‘v’ is x. So,
Final Value = 7 + x – 20
Given that the final value is 5, we can set up the equation:
5 = 7 + x – 20
Now, solve for ‘x’:
x = 5 – 7 + 20
x = 18
So, the value of ‘x’ is 18.
Subscribe
Login
0 Comments