GATE 2015 (Session 1)
65 questions
MCQ 45 · NAT 201-mark 30 · 2-mark 35
Questions 36–40 of 65
Suppose that the stop-and-wait protocol is used on a link with a bit rate of 64 kilobits per second and 20 milliseconds propagation delay. Assume that the transmission time for the acknowledgement and the processing time at nodes are negligible. Then the minimum frame size in bytes to achieve a link utilization of at least 50% is______________.
Answer: 320
The utilization of stop-and-wait is given by ms.
So the frame size is bits, which is 320 bytes.
Answer: 320
Note: The official GATE 2015 answer key gave 160 bytes, which counts only the one-way propagation delay. Stop-and-wait must also wait for the acknowledgement to come back, so 50% utilization needs a transmission time of 2 × 20 ms = 40 ms, which is 320 bytes.
So the frame size is bits, which is 320 bytes.
Answer: 320
Note: The official GATE 2015 answer key gave 160 bytes, which counts only the one-way propagation delay. Stop-and-wait must also wait for the acknowledgement to come back, so 50% utilization needs a transmission time of 2 × 20 ms = 40 ms, which is 320 bytes.
Consider a max heap, represented by the array: 40, 30, 20, 10, 15, 16, 17, 8, 4.
Now consider that a value 35 is inserted into this heap. After insertion, the new heap is
Now consider that a value 35 is inserted into this heap. After insertion, the new heap is
Answer: (B)
Put 35 in the next empty place, which is index 10. It becomes the child of 15.
- Compare 35 and 15: 35 15, so swap 35 moves under 30.
- Compare 35 and 30: 35 30, so swap 35 moves under 40.
- Compare 35 and 40: 35 40, so stop.
Final heap: 40, 35, 20, 10, 30, 16, 17, 8, 4, 15
Answer: 40, 35, 20, 10, 30, 16, 17, 8, 4, 15
- Compare 35 and 15: 35 15, so swap 35 moves under 30.
- Compare 35 and 30: 35 30, so swap 35 moves under 40.
- Compare 35 and 40: 35 40, so stop.
Final heap: 40, 35, 20, 10, 30, 16, 17, 8, 4, 15
Answer: 40, 35, 20, 10, 30, 16, 17, 8, 4, 15
Consider the following C program segment.
while(first <= last)
{
if (array[middle] < search)
first = middle + 1;
else if (array[middle] == search)
found = TRUE;
else last = middle - 1;
middle = (first + last)/2;
}
if (first > last) notPresent = TRUE;The cyclomatic complexity of the program segment is ________.Answer: 5
For code whose decisions each test a single condition, cyclomatic complexity = number of decision points + 1.
Decision points: the while condition, the if, the else if, and the last if, 4 in all.
The flow graph gives the same: with nodes for the while test, if test, first = ..., else-if test, found = ..., last = ..., middle = ..., last if test, notPresent = ... and the exit, there are N = 10 nodes and E = 13 edges, so .
Answer: 5
Decision points: the while condition, the if, the else if, and the last if, 4 in all.
The flow graph gives the same: with nodes for the while test, if test, first = ..., else-if test, found = ..., last = ..., middle = ..., last if test, notPresent = ... and the exit, there are N = 10 nodes and E = 13 edges, so .
Answer: 5
Consider a LAN with four nodes . Time is divided into fixed-size slots, and a node can begin its transmission only at the beginning of a slot. A collision is said to have occurred if more than one node transmit in the same slot. The probabilities of generation of a frame in a time slot by are 0.1, 0.2, 0.3 and 0.4, respectively. The probability of sending a frame in the first slot without any collision by any of these four stations is _____________.
Answer: 0.4 to 0.46
A frame is sent without collision when exactly one station transmits.
- S1 alone: 0.1 0.8 0.7 0.6 = 0.0336
- S2 alone: 0.9 0.2 0.7 0.6 = 0.0756
- S3 alone: 0.9 0.8 0.3 0.6 = 0.1296
- S4 alone: 0.9 0.8 0.7 0.4 = 0.2016
Adding all four, the total = 0.4404
Answer: 0.44
- S1 alone: 0.1 0.8 0.7 0.6 = 0.0336
- S2 alone: 0.9 0.2 0.7 0.6 = 0.0756
- S3 alone: 0.9 0.8 0.3 0.6 = 0.1296
- S4 alone: 0.9 0.8 0.7 0.4 = 0.2016
Adding all four, the total = 0.4404
Answer: 0.44
The binary operator is defined by the following truth table.
Which one of the following is true about the binary operator ?
Which one of the following is true about the binary operator ?
Answer: (A)
The given table matches the XOR operation exactly .
XOR is commutative and it is also associative .
Answer: Both commutative and associative
XOR is commutative and it is also associative .
Answer: Both commutative and associative