Returns the vertices in postorder.
the vertices in postorder, as an iterable of vertices
Returns the postorder number of vertex v
.
the vertex
the postorder number of vertex v
or -1 if the vertex is not in the graph.
Returns the vertices in preorder.
the vertices in preorder, as an iterable of vertices
Returns the preorder number of vertex v
.
the vertex
the preorder number of vertex v
or -1 if the vertex is not in the graph.
Returns the vertices in reverse postorder.
the vertices in reverse postorder, as an iterable of vertices
Generated using TypeDoc
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.For additional documentation, see Section 4.2 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.