for linked binary treesa reasonable set of update methods to support for general usage are the followingt add root( )create root for an empty treestoring as the elementand return the position of that rootan error occurs if the tree is not empty add left(pe)create new node storing element elink the node as the left child of position pand return the resulting positionan error occurs if already has left child add right(pe)create new node storing element elink the node as the right child of position pand return the resulting positionan error occurs if already has right child replace(pe)replace the element stored at position with element eand return the previously stored element delete( )remove the node at position preplacing it with its childif anyand return the element that had been stored at pan error occurs if has two children attach(pt )attach the internal structure of trees and respectivelyas the left and right subtrees of leaf position of tand reset and to empty treesan error condition occurs if is not leaf we have specifically chosen this collection of operations because each can be implemented in ( worst-case time with our linked representation the most complex of these are delete and attachdue to the case analyses involving the various parent-child relationships and boundary conditionsyet there remains only constant number of operations to perform (the implementation of both methods could be greatly simplified if we used tree representation with sentinel nodeakin to our treatment of positional listssee exercise - to avoid the problem of undesirable update methods being inherited by subclasses of linkedbinarytreewe have chosen an implementation in which none of the above methods are publicly supported insteadwe provide nonpublic versions of eachfor exampleproviding the underscored delete in lieu of public delete our implementations of these six update methods are provided in code fragments and in particular applicationssubclasses of linkedbinarytree can invoke the nonpublic methods internallywhile preserving public interface that is appropriate for the application subclass may also choose to wrap one or more of the nonpublic update methods with public method to expose it to the user we leave as an exercise ( - )the task of defining mutablelinkedbinarytree subclass that provides public methods wrapping each of these six update methods