next up previous
Next: Up: Previous:

Pseudocode

TopologicalSort(G) $\;\;\;\;\;$ $\;\;\;\;\;$ $\;\;\;\;\;$; $\Theta(V+E)$
$\;\;\;\;\;$DFS(G), as each vertex finishes, insert it on the front of
$\;\;\;\;\;$ $\;\;\;\;\;$ $\;\;\;\;\;$the linked list
$\;\;\;\;\;$return linked list of vertices


next up previous
Next: Up: Previous: