Multiple ChoiceHard 30s
Cycle Detection
In a directed graph, cycle detection is cleanest with:
Options
- 1BFS only, marking each node on dequeue
- 2Sorting all edges by weight first
- 3DFS with a recursion stack (colors)
- 4A hash of node values seen so far
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.