1.

Topological sort of a Directed Acyclic graph is?(a) Always unique(b) Always Not unique(c) Sometimes unique and sometimes not unique(d) Always unique if graph has even number of verticesThe question was posed to me during an interview for a job.I'm obligated to ask this question of Topological Sort in chapter Miscellaneous of Data Structures & Algorithms II

Answer» CORRECT choice is (C) Sometimes unique and sometimes not unique

To explain: The topological SORT of a graph can be unique if we assume the graph as a single linked list and we can have multiple topological sort ORDER if we consider a graph as a complete binary tree.


Discussion

No Comment Found

Related InterviewSolutions