1.

The topological sorting of any DAG can be done in ________ time.(a) cubic(b) quadratic(c) linear(d) logarithmicI'm obligated to ask this question of Directed Acyclic Graph topic in division Graph of Data Structures & Algorithms IThis question was addressed to me during an interview.

Answer»

The CORRECT choice is (c) linear

To explain: Topological sorting can be done in O(V+E), here V and E REPRESENTS number of vertices and number of EDGES respectively.



Discussion

No Comment Found

Related InterviewSolutions