more complex scenario arises when the node we want to delete has two childrenwe cannot simply replace node with either node or what we need to do is to find the next biggest descendant of node this is node to get to node we move to the right node of node and then move left to find the leftmost node node is called the in-order successor of node the second step resembles the move to find the maximum node in sub-tree we replace the value of node with the value and remove node in removing node we end up with simpler form of node removal that has been addressed previously node has no childrenso we apply the rule for removing nodes without children accordingly our node class does not have reference to parent as suchwe need to use helper method to search for and return the node with its parent node this method is similar to the search methoddef get_node_with_parent(selfdata)parent none current self root_node if current is nonereturn (parentnonewhile trueif current data =datareturn (parentcurrentelif current data dataparent current current current left_child elseparent current current current right_child return (parentcurrent