sec binary search trees /*remove and return the root node from the dictionary @return the record removednull if tree is empty *public removeany(if (root !nulle temp root element()root removehelp(rootroot key())nodecount--return tempelse return null/*@return record with key value knull if none exist @param the key value to find *public find(key kreturn findhelp(rootk)/*@return the number of records in the dictionary *public int size(return nodecountfigure (continuedonce the desired record is foundit is passed up the chain of recursive calls to findhelp in the third parameter"it the return value for the function (true or falsedepending on whether suitable element has been foundis also simply passed back up the chain of recursive calls inserting record with key value requires that we first find where that record would have been if it were in the tree this takes us to either leaf nodeor to an internal node with no child in the appropriate direction call this node we then add new node containing the new record as child of figure illustrates this operation the value is added as the right child of the node with value here is the implementation for inserthelpprivate bstnode inserthelp(bstnode rtkey ke eif (rt =nullreturn new bstnode(ke)if (rt key(compareto( rt setleft(inserthelp(rt left()ke))else rt setright(inserthelp(rt right()ke))return rt this assumes that no node has key value equal to the one being inserted if we find node that duplicates the key value to be insertedwe have two options if the application does not allow nodes with equal keysthen this insertion should be treated as an error (or ignoredif duplicate keys are allowedour convention will be to insert the duplicate in the right subtree