private void DFS(Digraph g, int v) { _pre.Enqueue(v); _marked[v] = true; foreach (var w in g.Adjacent(v)) { if (!_marked[w]) { DFS(g, w); } } _post.Enqueue(v); _reversePost.Push(v); }
public static double AverageDegreeOut(Digraph g) { return((double)g.E / g.V); }