chap binary trees subroot figure an example of deleting the node with minimum value in this treethe node with minimum value is the left child of the root thusthe root' left pointer is changed to point to ' right child thusthe question becomeswhich value can substitute for the one being removedit cannot be any arbitrary valuebecause we must preserve the bst property without making major changes to the structure of the tree which value is most like the one being removedthe answer is the least key value greater than (or equal tothe one being removedor else the greatest key value less than the one being removed if either of these values replace the one being removedthen the bst property is maintained example assume that we wish to remove the value from the bst of figure (ainstead of removing the root nodewe remove the node with the least value in the right subtree (using the deletemin operationthis value can then replace the value in the root in this example we first remove the node with value because it contains the least value in the right subtree we then substitute as the new value for the root node figure illustrates this process when duplicate node values do not appear in the treeit makes no difference whether the replacement is the greatest value from the left subtree or the least value from the right subtree if duplicates are storedthen we must select the replacement from the right subtree to see whycall the greatest value in the left subtree if multiple nodes in the left subtree have value gselecting as the replacement value for the root of the subtree will result in tree with equal values to the left of the node now containing precisely this situation occurs if we replace value with the greatest value in the left subtree of figure (bselecting the least value