MSQ2 marks
Let be a simple, undirected, edge-weighted graph with unique edge weights.
Which of the following statements about the minimum spanning trees (MST) of is/are true?
One or more correct
GATE CSE previous year questions · Algorithms
One or more correct
DFS(G): Explore(G, v, t):
unmark all v ∈ V mark v
t ← 0 t ← t + 1
for each v ∈ V d[v] ← t
if v is unmarked for each (v, w) ∈ E
t ← Explore(G, v, t) if w is unmarked
end if t ← Explore(G, w, t)
end for end if
end for
t ← t + 1
f[v] ← t
return t
Suppose that the input directed graph is a directed acyclic graph (DAG).
For an edge , which of the following options will NEVER be correct?One or more correct
One or more correct
One or more correct
One or more correct
One or more correct
One or more correct
Answer key coming soon
Function 1 Function 2
while n > 1 do for i = 1 to 100 * n do
for i = 1 to n do x = x + 1;
x = x + 1; end for
end for
n = floor(n/2);
end while
Let and denote the number of times the statement "x = x + 1" is executed in Function 1 and Function 2, respectively.
Which of the following statements is/are TRUE?One or more correct
Answer key coming soon
One or more correct
Answer key coming soon
One or more correct
Answer key coming soon
One or more correct
Answer key coming soon
One or more correct
Answer key coming soon

One or more correct
Answer key coming soon