chap binary trees import java lang comparable/*binary search tree implementation for dictionary adt *class bsteimplements dictionary private bstnode root/root of the bst int nodecount/number of nodes in the bst /*constructor *bst(root nullnodecount /*reinitialize tree *public void clear(root nullnodecount /*insert record into the tree @param key value of the record @param the record to insert *public void insert(key ke eroot inserthelp(rootke)nodecount++/*remove record from the tree @param key value of record to remove @return the record removedor null if there is none *public remove(key ke temp findhelp(rootk)/first find it if (temp !nullroot removehelp(rootk)/now remove it nodecount--return tempfigure class declaration for the binary search tree the record if it is found howeverthe find operation is most easily implemented as recursive function whose parameters are the root of bst subtreethe search keyand space for the element once it is found member findhelp is of the desired form for this recursive subroutine and is implemented as followsprivate findhelp(bstnode rtkey kif (rt =nullreturn nullif (rt key(compareto( return findhelp(rt left() )else if (rt key(compareto( = return rt element()else return findhelp(rt right() )