Let's say that there is one vertex with the following property in a DAG
:
All vertices are connected to it
It is not connected to any vertex
This is usually called a sink vertex.
Is it possible to detect this vertex in O(n)
, where n
is number of vertices in graph?