Implemented topological sorting on a unweighted graph.