Question 51
int func(int m, int n)
{
if (E) return 1;
else return(func(m -1, n) + func(m - 1, n - 1));
}
Question 53
Question 54
Question 55
Question 56
The wait and signal operations of a monitor are implemented using semaphores as follows. In the following,
P(mutex); body of procedure if (next_count > 0) V(next); else V(mutex);
Each occurrence of x.wait is replaced with the following:
x_count = x_count + 1; if (next_count > 0) V(next) else V(mutex); ---------------------------------- E1; x_count = x_count - 1;
Each occurrence of x.signal is replaced with the following:
if (x_count > 0) { next_count = next_count + 1; ---------------------------------- E2; P(next), next_count = next_count - 1; }
For correct implementation of the monitor, statements E1 and E2 are, respectively,
Question 57
Question 58
Question 59
Question 60
There are 86 questions to complete.