Tarjan's DFS based algorithm (Topological Sorting Topological Sorting)

From Algorithm Wiki
Jump to navigation Jump to search

Time Complexity

$O(V+E)$

Space Complexity

$O(V)$? words

(maintain O(V)-sized recursion stack, along with O(V) marks)

Description

Approximate?

Exact

Randomized?

No, deterministic

Model of Computation

Word RAM

Year

1976

Reference

https://link.springer.com/article/10.1007/BF00268499