Math, asked by aliachowdhury276, 5 hours ago

Write an algorithm to find cycle in a Graph​

Answers

Answered by aj2925538
0

Answer:

To detect cycle, check for a cycle in individual trees by checking back edges. 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.

Answered by sakeenabanu112
0

Answer:

To detect cycle, check for a cycle in individual trees by checking back edges. 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.

Similar questions