class RGL::DFSIterator
Iterator for a depth first search, starting at a given vertex. The only difference from BFSIterator
is that @waiting is a stack, instead of a queue.
Note that this is different from DFSVisitor
, which is used in the recursive version for depth first search (see depth_first_search).
Public Instance Methods
next_vertex()
click to toggle source
# File lib/rgl/traversal.rb 137 def next_vertex 138 # waiting is a stack 139 @waiting.pop 140 end