Interface Dfs.Iter<V,​E>

  • Type Parameters:
    V - the vertices type
    E - the edges type
    All Superinterfaces:
    Iterator<V>
    All Known Subinterfaces:
    Dfs.IntIter
    Enclosing interface:
    Dfs

    public static interface Dfs.Iter<V,​E>
    extends Iterator<V>
    A DFS iterator.
    Author:
    Barak Ugav
    • Method Detail

      • hasNext

        boolean hasNext()
        Check whether there is more vertices to iterate over.
        Specified by:
        hasNext in interface Iterator<V>
      • next

        V next()
        Advance the iterator and return a vertex that was not visited by the iterator yet.
        Specified by:
        next in interface Iterator<V>
      • edgePath

        List<E> edgePath()
        Get the path from the source to the last vertex returned by next().

        The behavior is undefined if next() was not called yet.

        Returns:
        list of edges forming a path from the source to the last vertex returned by next(). The returned list should not be modified by the user.