X Interview Question

How to detect a cycle in a directed graph

Interview Answer

Anonymous

Feb 22, 2019

DFS and having a visited[] array and mark the visited when you visit the node.