Algorithms | Graph Traversals | Question 1

Which of the following algorithms can be used to most efficiently determine the presence of a cycle in a given graph ?
(A) Depth First Search
(B) Breadth First Search
(C) Prim’s Minimum Spanning Tree Algorithm
(D) Kruskal’ Minimum Spanning Tree Algorithm


Answer: (A)

Explanation: See https://www.geeksforgeeks.org/applications-of-depth-first-search/ and https://www.geeksforgeeks.org/depth-first-traversal-for-a-graph/

Quiz of this Question



My Personal Notes arrow_drop_up