In this article, we have explored how to perform topological sort using Breadth First Search (BFS) along with an implementation. We have compared it with Topological sort using Depth First Search (DFS).
Let us consider a scenario where a university offers a bunch of courses . There are some dependent courses too.
Example : Machine Learning is dependent on Python and Calculus , CSS dependent on HTML etc.
All these dependencies can be documented into a directed graph. Now the university wants...
Published on May 06, 2020 15:39