as we walk down the treewe need to keep track of the current node we are working onas well as its parent the variable current is always used for this purposecurrent self root_node parent none while trueparent current here we must perform comparison if the data held in the new node is less than the data held in the current nodethen we check whether the current node has left child node if it doesn'tthis is where we insert the new node otherwisewe keep traversingif node data current datacurrent current left_child if current is noneparent left_child node return now we take care of the greater than or equal case if the current node doesn' have right child nodethen the new node is inserted as the right child node otherwisewe move down and continue looking for an insertion pointelsecurrent current right_child if current is noneparent right_child node return insertion of node in bst takes ( )where is the height of the tree deleting nodes another important operation on bst is the deletion or removal of nodes there are three scenarios that we need to cater for during this process the node that we want to remove might have the followingno children one child two children