GATE 2026 (Session 1)
65 questions
MCQ 28 · MSQ 24 · NAT 131-mark 30 · 2-mark 35
Questions 41–45 of 65
Let be an undirected, edge-weighted graph with integer weights. The weight of a path is the sum of the weights of the edges in that path. The length of a path is the number of edges in that path.
Let be a vertex in . For every and for every , let denote the weight of a shortest path (in terms of weight) from to of length at most . If there is no path from to of length at most , then .
Consider the statements:
S1: For every and .
S2: For every , if is part of a shortest path (in terms of weight) from to , then for every .
Which one of the following options is correct?
Let be a vertex in . For every and for every , let denote the weight of a shortest path (in terms of weight) from to of length at most . If there is no path from to of length at most , then .
Consider the statements:
S1: For every and .
S2: For every , if is part of a shortest path (in terms of weight) from to , then for every .
Which one of the following options is correct?
Answer: (A)
is the least weight among paths from to with at most edges.
S1 is true. Every path with at most edges also has at most edges. So is a minimum over a larger set of paths, and it cannot be bigger than .
S2 is false. The condition only says lies on some shortest path to ; it does not say that path is short in edges. Counterexample: edges , , with weight 0, and an edge with weight 5. The path has weight 0, so it is a shortest path to and it uses the edge . For : (direct edge), but is 2 edges from , so . Then fails.
Only S1 is true.
Answer: (A)
S1 is true. Every path with at most edges also has at most edges. So is a minimum over a larger set of paths, and it cannot be bigger than .
S2 is false. The condition only says lies on some shortest path to ; it does not say that path is short in edges. Counterexample: edges , , with weight 0, and an edge with weight 5. The path has weight 0, so it is a shortest path to and it uses the edge . For : (direct edge), but is 2 edges from , so . Then fails.
Only S1 is true.
Answer: (A)
Consider the control flow graph shown in the figure.
Which one of the following options correctly lists the set of redundant expressions (common subexpressions) in the basic blocks B and B?
Note: All the variables are integers.
Which one of the following options correctly lists the set of redundant expressions (common subexpressions) in the basic blocks B and B?
Note: All the variables are integers.
Answer: (D)
An expression is redundant at a statement if it is computed on every path that reaches the statement, and none of its operands is assigned after that computation. B4 can be reached by B1, B2, B4 and by B1, B3, B4. B5 is reached only through B4.
B4, g*k: it is computed in B2 (a = g * k) and in B3 (t = g * k). Neither path assigns g or k afterwards (B2 assigns a and f, B3 assigns t and b). So g * k is available on both paths, and x = g * k in B4 is redundant.
B4, b+i: it is computed in B1, and B2 does not change b or i, so it is still available on the B2 path. But B3 assigns b = c + m, which kills b + i on the B3 path. So y = b + i is not redundant.
B5, c+m: it is computed only in B3, as b = c + m. The path through B2 never computes it, and B4 does not compute it either. So c + m is not available at B5, and z = c + m is not redundant.
So the redundant expressions are B4: {g * k} and B5: { }. Options A and C wrongly list b + i, and option B wrongly lists c + m.
Answer: (D)
B4, g*k: it is computed in B2 (a = g * k) and in B3 (t = g * k). Neither path assigns g or k afterwards (B2 assigns a and f, B3 assigns t and b). So g * k is available on both paths, and x = g * k in B4 is redundant.
B4, b+i: it is computed in B1, and B2 does not change b or i, so it is still available on the B2 path. But B3 assigns b = c + m, which kills b + i on the B3 path. So y = b + i is not redundant.
B5, c+m: it is computed only in B3, as b = c + m. The path through B2 never computes it, and B4 does not compute it either. So c + m is not available at B5, and z = c + m is not redundant.
So the redundant expressions are B4: {g * k} and B5: { }. Options A and C wrongly list b + i, and option B wrongly lists c + m.
Answer: (D)
Consider a relational database schema with two relations and . Let be a tuple relational calculus expression.
Which one of the following relational algebraic expressions is equivalent to ?
Which one of the following relational algebraic expressions is equivalent to ?
Answer: (B)
gives every for which some tuple is in and a tuple with the same is in .
The second attribute of () plays the role of , and so does the first attribute of (). So we need a join with the condition . Because and have no common attribute names, this must be written as an explicit equi-join; a natural join would give a Cartesian product. Then we keep only , which is .
. A join is commutative, so writing or first makes no difference.
Why the others fail: (A) and (C) compare , which is , instead of . (D) compares , which is , with .
Answer: (B)
The second attribute of () plays the role of , and so does the first attribute of (). So we need a join with the condition . Because and have no common attribute names, this must be written as an explicit equi-join; a natural join would give a Cartesian product. Then we keep only , which is .
. A join is commutative, so writing or first makes no difference.
Why the others fail: (A) and (C) compare , which is , instead of . (D) compares , which is , with .
Answer: (B)
A TCP sender successfully establishes a connection with a TCP receiver and starts the transmission of segments. The TCP congestion control mechanism's slow-start threshold is set to segments. Assume that the round-trip time is fixed at millisecond. Assume that the sender always has data to send, the segments are numbered from , and no segment is lost. Let denote the time (in milliseconds) at which the transmission of segment number starts.
Which one of the following options is correct?
Which one of the following options is correct?
Answer: (B)
In slow start, the congestion window (in segments) doubles every RTT as long as it stays below the threshold. It starts from segment. The threshold is , which is far above anything we will reach here.
Segment number is in the batch that starts at time ms, because that batch covers segments to .
Answer:
Segment number is in the batch that starts at time ms, because that batch covers segments to .
Answer:
Consider the implementation of sliding window protocol over a lossless link, with a window size of frames, where each frame is of size bits (including header). The bandwidth of the link is and the one-way propagation delay is milliseconds. Assume that processing times at the sender and receiver are zero and the transmission time of acknowledgements is also zero. Which one of the following options gives the minimum size of (in number of frames) required to achieve link utilization?
Answer: (B)
Transmission time is ms.
To reach link utilization with a sliding window, the sender has to keep sending without a break until the acknowledgement of the first frame comes back. That time is . It is the one-way propagation to the receiver, plus the one-way propagation for the ack to return, with zero processing time and zero ack transmission time.
So the condition is: .
Answer: 21
To reach link utilization with a sliding window, the sender has to keep sending without a break until the acknowledgement of the first frame comes back. That time is . It is the one-way propagation to the receiver, plus the one-way propagation for the ack to return, with zero processing time and zero ack transmission time.
So the condition is: .
Answer: 21