GATE-CS-2009 (original) (raw)

The enter_CS() and leave_CS() functions to implement critical section of a process are realized using test-and-set instruction as follows:

void enter_CS(X)
{
while test-and-set(X) ;
}
void leave_CS(X)
{
X = 0;
}

In the above solution, X is a memory location associated with the CS and is initialized to 0. Now consider the following statements: I. The above solution to CS problem is deadlock-free II. The solution is starvation free. III. The processes enter CS in FIFO order. IV More than one process can enter CS at the same time. Which of the above statements is TRUE?

Consider the data of previous question. Suppose that the sliding window protocol is used with the sender window size of 2i where is the number of bits identified in the previous question and acknowledgments are always piggybacked. After sending 2i frames, what is the minimum time the sender will have to wait before starting transmission of the next frame? (Identify the closest choice ignoring the frame processing time.)

Let G(x) be the generator polynomial used for CRC checking. What is the condition that should be satisfied by G(x) to detect odd number of bits in error?

Frames of 1000 bits are sent over a 10^6 bps duplex link between two hosts. The propagation time is 25ms. Frames are to be transmitted into this link to maximally pack them in transit (within the link). What is the minimum number of bits (i) that will be required to represent the sequence numbers distinctly? Assume that no time gap needs to be given between transmission of two frames.

In quick sort, for sorting n elements, the (n/4)th smallest element is selected as a pivot using an O(n) time algorithm. What is the worst-case time complexity of the quick sort?

(A) θ(n)

(B) θ(nlogn)

(C) θ(n2)

(D) θ(n2 log n)

A sub-sequence of a given sequence is just the given sequence with some elements (possibly none or all) left out. We are given two sequences X[m] and Y[n] of lengths m and n respectively, with indexes of X and Y starting from 0. We wish to find the length of the longest common sub-sequence(LCS) of X[m] and Y[n] as l(m,n), where an incomplete recursive definition for the function l(i,j) to compute the length of The LCS of X[m] and Y[n] is given below:

l(i,j) = 0, if either i=0 or j=0
= expr1, if i,j > 0 and X[i-1] ****=** Y[j-1]
= expr2, if i,j > 0 and X[i-1] ****!=** Y[j-1]

A multilevel page table is preferred in comparison to a single level page table for translating virtual address to physical address because

In which one of the following page replacement policies, Belady’s anomaly may occur?

The essential content(s) in each entry of a page table is / are

A CPU generally handles an interrupt by executing an interrupt service routine

There are 60 questions to complete.

Take a part in the ongoing discussion