Depth-First Search (DFS) Algorithm for Topological Sorting
One could use the DFS Algorithm to identify the safe order for tasks execution (i.e., for tasks that depend on previous ones), also known as topological sort. Please, select the option that shows which of the following directed graphs above could have its topological order extracted through DFS.
I)
II)
III)
Consider the usage of only the DFS algorithm, without additional algorithms to detect strongly connected components and deal with cyclic graphs.
A. I.
B. I, and III.
C. I, II, and III.
D. III.
E. None of the above.
Original idea by: Felipe Crispim da Rocha Salvagnini
Good question. I took it after some editing.
ResponderExcluir