NonrecursiveDirectedDFS Class |
The NonrecursiveDirectedDFS class represents a data type for finding the vertices reachable from a source vertex S in the digraph. This implementation uses a nonrecursive version of depth-first search with an explicit stack.
The constructor takes time proportional to V + E, where V is the number of vertices and E is the number of edges. It uses extra space (not including the digraph) proportional to V.
Namespace: Algs4Net
public class NonrecursiveDirectedDFS
The NonrecursiveDirectedDFS type exposes the following members.
Name | Description | |
---|---|---|
![]() | NonrecursiveDirectedDFS |
Computes the vertices reachable from the source vertex s in the
digraph G. |
Name | Description | |
---|---|---|
![]() ![]() | MainTest |
Demo test the NonrecursiveDirectedDFS data type. |
![]() | Marked |
Is vertex v reachable from the source vertex s? |
For additional documentation, see Section 4.2 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.
This class is a C# port from the original Java class NonrecursiveDirectedDFS implementation by the respective authors.