Dear,
The graph shown topologically sorted. Its vertices are arranged from left to right in order of decreasing finiching time.
Topological Sort(G)
1. call DFS(G) to computer finishing times f[v] for each vertex v
2. as such vertex is finished, insert it it onto front of a linked list
3. return the linked list of vertices
we can perform a topological sort in time Θ (V+E) time and it takes O(1) time to insert each of the |V| vertices on to the front of linked list.