Topological Sort

Poornima
Jan 31, 2022

Complexity: O(num of vertices in the graph)

In order to find a particular sequencing or ordering of graph , we use topological sort. We push the vertices with zero in-degree into the queue and iteratively traverse the graph.

Points to Note:

  • This algorithm is applicable to Directed Acyclic Graphs
  • Use to find sequencing or dependencies

--

--