← Quit0 / 0 correct
How do you detect a cycle in a directed graph with DFS?
white: unvisited gray: on current DFS stack black: finished edge to a gray node ⇒ cycle
How do you detect a cycle in a directed graph with DFS?
white: unvisited gray: on current DFS stack black: finished edge to a gray node ⇒ cycle