Q50
Consider the following pseudocode for depth-first search (DFS) algorithm which takes a directed graph as input, where and are the discovery time and finishing time, respectively, of the vertex .
DFS(G):
unmark all v in V
t <- 0
for each v in V
if v is unmarked
t <- Explore(G, v, t)
end if
end for
Explore(G, v, t):
mark v
t <- t + 1
d[v] <- t
for each (v, w) in E
if w is unmarked
t <- Explore(G, w, t)
end if
end for
t <- t + 1
f[v] <- t
return tSuppose that the input directed graph is a directed acyclic graph (DAG).
For an edge , which of the following options will NEVER be correct?
For an edge , which of the following options will NEVER be correct?
More than one option can be correct.
Show answer without attempting
Answer: B, D




