1.

A person wants to visit some places. He starts from a vertex and then wants to visit every place connected to this vertex and so on. What algorithm he should use?(a) Depth First Search(b) Breadth First Search(c) Trim’s algorithm(d) Kruskal’s algorithmThe question was posed to me in an international level competition.My doubt stems from Breadth First Search in division Graph Search of Data Structures & Algorithms II

Answer»

Right answer is (b) Breadth FIRST SEARCH

Explanation: This is the DEFINITION of the Breadth First Search. Exploring a NODE, then it’s neighbors and so on.



Discussion

No Comment Found

Related InterviewSolutions