tree.rb
# Searches for a value, emiting nodes along the path to block
# Returns the value's node if found
Searches for a value, emiting nodes along the path to block
Returns the value's node if found
Searches for a value emiting nodes along the path to block Returns the value ' s node if found
def path(value, start_node = nil)
    node = start_node || @root
    until node.nil?
      return node if node.data == value
      yield node if block_given?
      node = value < node.data ? node.left : node.right
    end
  end
def path ( value , start_node = nil ) node = start_node || @root until node . nil? return node if node . data == value yield node if block_given? node = value < node . data ? node . left : node . right end end
Searches for a value, emiting nodes along the path to block
Returns the value's node if found
Searches for a value emiting nodes along the path to block Returns the value ' s node if found
value
<not_specific>
start_node
<not_specific>