How Do You Detect A Back Edge In DFS Traversing?
How Do You Detect A Back Edge In DFS Traversing? To detect a back edge, keep track of vertices currently in the recursion stack of function for DFS traversal. If a vertex is reached that is already in the recursion stack, then there is a cycle in the tree. The edge that connects the current