binary trees nextinsert(must determine where to insert the new node this is done using roughly the same code as finding nodedescribed in the section "java code for finding node the difference is that when you're simply trying to find node and you encounter null (non-existentnodeyou know the node you're looking for doesn' exist so you return immediately when you're trying to insert nodeyou insert it (creating it firstif necessarybefore returning the value to be searched for is the data item passed in the argument id the while loop uses true as its condition because it doesn' care if it encounters node with the same value as idit treats another node with the same key value as if it were simply greater than the key value (we'll return to the subject of duplicate nodes later in this place to insert new node will always be found (unless you run out of memory)when it isand the new node is attachedthe while loop exits with return statement here' the code for the insert(functionpublic void insert(int iddouble ddnode newnode new node()/make new node newnode idata id/insert data newnode ddata ddif(root==null/no node in root root newnodeelse /root occupied node current root/start at root node parentwhile(true/(exits internallyparent currentif(id current idata/go leftcurrent current leftchildif(current =null/if end of the line/insert on left parent leftchild newnodereturn/end if go left else /or go right