Ruby-BST/main.rb
# each_inorder_helper function: unless current node is nil, recursively calls itself on the left child, adds a new node with the yield on the current node using the block, and then recursively calls itself on the right child
each_inorder_helper function: unless current node is nil, recursively calls itself on the left child, adds a new node with the yield on the current node using the block, and then recursively calls itself on the right child
each_inorder_helper function : unless current node is nil recursively calls itself on the left child adds a new node with the yield on the current node using the block and then recursively calls itself on the right child
def collect_inorder_helper(node, newBST, &block)
    unless node.nil?
      collect_inorder_helper(node.left, newBST, &block)
      newBST.add(yield(node.value))
      collect_inorder_helper(node.right, newBST, &block)
    end
  end
def collect_inorder_helper ( node , newBST , & block ) unless node . nil? collect_inorder_helper ( node . left , newBST , & block ) newBST . add ( yield ( node . value ) ) collect_inorder_helper ( node . right , newBST , & block ) end end
each_inorder_helper function: unless current node is nil, recursively calls itself on the left child, adds a new node with the yield on the current node using the block, and then recursively calls itself on the right child
each_inorder_helper function : unless current node is nil recursively calls itself on the left child adds a new node with the yield on the current node using the block and then recursively calls itself on the right child
node
<not_specific>
newBST
<not_specific>
block
<not_specific>