×

Multiple-Choice Questions

Web Technologies MCQs

Computer Science Subjects MCQs

Databases MCQs

Programming MCQs

Testing Software MCQs

Digital Marketing Subjects MCQs

Cloud Computing Softwares MCQs

AI/ML Subjects MCQs

Engineering Subjects MCQs

Office Related Programs MCQs

Management MCQs

More

Advertisement


In BFS, what condition indicates the presence of a cycle in an undirected graph?

18. In BFS, what condition indicates the presence of a cycle in an undirected graph?

  1. If a node is visited twice during traversal.
  2. If the graph is connected.
  3. If the graph has more edges than vertices.
  4. If a node has no adjacent nodes.

Answer

The correct answer is: A) If a node is visited twice during traversal.

Explanation

In an undirected graph, if BFS encounters a node that has already been visited (and it is not the immediate parent node), it indicates the presence of a cycle.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.