Question: Which algorithm can be used to detect cycles in a directed graph?
Options:
Correct Answer: DFS
Solution:
DFS can be used to detect cycles in a directed graph by keeping track of visited nodes and the recursion stack.