* Topological sorting is possible only in case of DAG ( Directed Acyclic Graph ) . to check what is DAG go through this link : https://en.wikipedia.org/wiki/Directed ...