DepthFirstOrder Class |
The DepthFirstOrder class represents a data type for determining depth-first search ordering of the vertices in a digraph or edge-weighted digraph, including preorder, postorder, and reverse postorder.
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. Afterwards, the Preorder, Postorder, and Reverse postorder operation takes take time proportional to V.
Namespace: Algs4Net
public class DepthFirstOrder
The DepthFirstOrder type exposes the following members.
Name | Description | |
---|---|---|
![]() | DepthFirstOrder(Digraph) |
Determines a depth-first order for the digraph G. |
![]() | DepthFirstOrder(EdgeWeightedDigraph) |
Determines a depth-first order for the edge-weighted digraph G. |
Name | Description | |
---|---|---|
![]() ![]() | MainTest |
Demo test the DepthFirstOrder data type. |
![]() | Post |
Returns the vertices in postorder. |
![]() | Post(Int32) |
Returns the postorder number of vertex v. |
![]() | Pre |
Returns the vertices in preorder. |
![]() | Pre(Int32) |
Returns the preorder number of vertex v. |
![]() | ReversePost |
Returns the vertices in reverse postorder. |
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 DepthFirstOrder implementation by the respective authors.