1.

When the Breadth First Search of a graph is unique?(a) When the graph is a Binary Tree(b) When the graph is a Linked List(c) When the graph is a n-ary Tree(d) When the graph is a Ternary TreeThe question was asked by my school principal while I was bunking the class.My question is taken from Breadth First Search topic in portion Graph Search of Data Structures & Algorithms II

Answer»

The correct answer is (b) When the graph is a LINKED List

Explanation: When EVERY node will have one successor then the Breadth First Search is UNIQUE. In all other cases, when it will have more than one successor, it can choose any of them in arbitrary order.



Discussion

No Comment Found

Related InterviewSolutions