Topological sort can be implemented by?

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 search
 
Answer: C
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.
 

Tìm kiếm

Back
Top