1.

Topological sort is equivalent to which of the traversals in trees?(a) Pre-order traversal(b) Post-order traversal(c) In-order traversal(d) Level-order traversalThis question was posed to me by my college professor while I was bunking the class.Asked question is from Topological Sort in division Miscellaneous of Data Structures & Algorithms II

Answer»

Correct answer is (a) Pre-order traversal

The best I can EXPLAIN: In pre-order traversal of TREES, we process the root FIRST and then CHILD from LEFT to right.



Discussion

No Comment Found

Related InterviewSolutions