Topological sort

how we can find the no. of indegree is zero  in topological sort in o(v) time if we examine every node is it connected or not than it will take o(v2)???

1Comment
Sumit Verma @sumitkgp
10 May 2017 05:52 pm

no. of indegee is zero?
Can you explain the question a little bit ?
Topological Sorting requires DFS [O(V+E)] to find the order of the vertices.
Have a look here:
https://www.youtube.com/watch?time_continue=401&v=Q9PIxaNGnig