Class DFS.Node<V>

  • Type Parameters:
    V - vertex type
    All Implemented Interfaces:
    Comparable<GraphTraversal.Node<V>>
    Enclosing class:
    DFS<V>

    public static class DFS.Node<V>
    extends BFS.Node<V>
    This is a node in a DFS-spanning tree.
    • Field Detail

      • finishTime

        protected int finishTime
      • isCyclic

        protected boolean isCyclic
    • Constructor Detail

      • Node

        protected Node​(V vertex)
        Constructs a node for a spanning tree.
        Parameters:
        vertex - the node
    • Method Detail

      • color

        public DFS.Node.Color color()
        Gets the color of this node.
        Returns:
        the color
      • finishTime

        public int finishTime()
        Gets the finish time, the time to finish visiting its sub-tree, of this node.
        Returns:
        the finish time
      • isCyclic

        public boolean isCyclic()
        Check whether this node is on a cyclic path of the graph.
        Returns:
        true if this node is on a cyclic path of the graph