tree insert left

if the following are true:
  • val < a
  • the element at index i of stack tree = node (a, (-1), right)

then output of the bst_insert function where input tree is tree, value is val and index is i = result of storing (node (a, (length of stack tree), right)) at index i of stack (result of appending (node (val, (-1), (-1))) to tree)


Comments

Please log in to add comments