1.

Topological sort can be implemented by?(a) Using Depth First Search(b) Using Breadth First Search(c) Using Depth and Breadth First Search(d) Using level ordered searchI got this question in semester exam.I would like to ask this question from Topological Sort in division Miscellaneous of Data Structures & Algorithms II

Answer»

Right option is (c) Using Depth and Breadth First Search

For explanation: We can implement topological sort by both BFS and DFS. In BFS, we use queue as data structure and in DFS, we use LINKED LIST (if recursive) or Stack (if not recursive) as data structure.



Discussion

No Comment Found

Related InterviewSolutions