Graph Theory37 sections · 1633 units
Open in Course

Quiz: Cycle Detection in Directed Graphs

Knowledge check

Check Your Understanding

In directed graph cycle detection, you use 33 colors: white (unvisited), gray (in current path), black (fully processed). You find a cycle when DFS encounters which color?

  1. A.White. An unvisited node means you have gone in a circle
  2. B.Gray. A node still on the current recursion stack means you have found a back edge
  3. C.Black. A fully processed node means you are revisiting it
  4. D.Any non-white color indicates a cycle
Start the roadmap to answer the quizzes and solve the challenges