tree delete single right child parent

if the following are true:
  • index of value value in tree = i
  • the element at index i of stack tree = node (value, (-1), right)
  • the element at index right of stack tree = node (rvalue, rleft, rright)
  • find parent index of tree = p
  • the element at index p of stack tree = node (pval, i, pright)

then pop value from tree tree = result of storing (node (value, (-1), (-1))) at index i of stack (result of storing (node (pval, right, pright)) at index p of stack tree)


Comments

Please log in to add comments