lib/ruby_algorithms/algorithms/search/graphs/bst.rb
def in_order(node=@root, &block)
    return if node.nil?
    in_order(node.left, &block)
    yield node
    in_order(node.right, &block)
  end
# This is in order traversal (recursive implementation). Notice how the yield
# for visting the node is in between the two recursive calls for left and
# right nodes respectively.
This is in order traversal (recursive implementation). Notice how the yield
for visting the node is in between the two recursive calls for left and
right nodes respectively.
This is in order traversal ( recursive implementation ) . Notice how the yield for visting the node is in between the two recursive calls for left and right nodes respectively .
def in_order(node=@root, &block)
    return if node.nil?
    in_order(node.left, &block)
    yield node
    in_order(node.right, &block)
  end
def in_order ( node = @root , & block ) return if node . nil? in_order ( node . left , & block ) yield node in_order ( node . right , & block ) end
This is in order traversal (recursive implementation).
This is in order traversal ( recursive implementation ) .
node
block