after copying the element containing the successor keythe node originally containing the successor has to be removed from the right subtreeas shown in figure (cthis can be done by calling the bstremove(method and passing it the root of the subtree the result of removing the successor node is illustrated in figure (dthe bstremove(method is shown in listing along with the remove(map operationwhich uses the recursive helper method to remove an entry from the tree the size field is decremented to reflect the change listing delete key from the binary search tree class bstmap removes the map entry associated with the given key def removeselfkey )assert key in self"invalid map key self _root self _bstremoveself _rootkey self _size - helper method that removes an existing item recursively def _bstremoveselfsubtreetarget )search for the item in the tree if subtree is none return subtree elif target subtree key subtree left self _bstremovesubtree lefttarget return subtree elif target subtree key subtree right self _bstremovesubtree righttarget return subtree we found the node containing the item else if subtree left is none and subtree right is none return none elif subtree left is none or subtree right is none if subtree left is not none return subtree left else return subtree right else successor self _bstminimumsubtree right subtree key successor key subtree value successor value subtree right self _bstremovesubtree rightsuccessor key return subtree efficiency of binary search trees the time-complexities for the binary search tree operations are listed in table this evaluation assumes the tree contains nodes we begin with the bstsearch(