title: Counting incoming edges in a directed acyclic graph
body: <p>Given a directed acyclic graph (DAG), is there an algorithm that runs in <strong>linear time</strong> that counts the in-degree of each vertex (and the source of that edge), given that we know a root node (a node that from it you can reach every other vertex)?</p>