GATE Exam | Aptitude Questions | GATE Syllabus | GATE Result | Mock Test | GATE Preparation
0 votes

Which of the following condition is sufficient to detect cycle in a directed graph?

A

There is an edge from currently being visited node to an already visited node.

B

There is an edge from currently being visited node to an ancestor of currently visited node in DFS forest.

C

Every node is seen twice in DFS.

D

None of the bove

asked in trees, binary search trees, binary heaps by gate

1 Answer

0 votes

There is an edge from currently being visited node to an ancestor of currently visited node in DFS forest.

answered by gate

Related questions

The best answer to any question