DepthFirstSearch Class |
The DepthFirstSearch class represents a data type for determining the vertices connected to a given source vertex S in an undirected graph. For versions that find the paths, see and . This implementation uses depth-first search.
The constructor takes time proportional to V + E (in the worst case), where V is the number of vertices and E is the number of edges. It uses extra space (not including the graph) proportional to V.
Namespace: Algs4Net
public class DepthFirstSearch
The DepthFirstSearch type exposes the following members.
Name | Description | |
---|---|---|
![]() | DepthFirstSearch | Computes the vertices in graph G that are
connected to the source vertex s. |
Name | Description | |
---|---|---|
![]() ![]() | MainTest |
Demo test the DepthFirstSearch data type. |
![]() | Marked |
Is there a path between the source vertex s and vertex v? |
For additional documentation, see Section 4.1 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.
This class is a C# port from the original Java class DepthFirstSearch implementation by the respective authors.