1.

Topological sort can be applied to which of the following graphs?(a) Undirected Cyclic Graphs(b) Directed Cyclic Graphs(c) Undirected Acyclic Graphs(d) Directed Acyclic GraphsI have been asked this question during a job interview.The doubt is from Topological Sort topic in section Miscellaneous of Data Structures & Algorithms II

Answer»

Correct answer is (d) DIRECTED ACYCLIC Graphs

Easiest explanation - Every Directed Acyclic Graph has one or more topological ordering WHEREAS Cyclic and Undirected graphs can’t be ORDERED TOPOLOGICALLY.



Discussion

No Comment Found

Related InterviewSolutions