Directed graph topological sort Using BFS

Why do we need Indegree for

based on indegree only you will push the elements in queue right? one node having indegree 0 can be the src to reach rest of the nodes. rest is nothing but bfs.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.