1.

When the Depth 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 TreeThis question was addressed to me in a national level competition.The above asked question is from Depth First Search in portion Graph Search of Data Structures & Algorithms II

Answer»

Correct choice is (b) When the graph is a Linked List

To EXPLAIN: When Every node will have one successor then the Depth 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