data structures using (step (step (step lost in the process we will take up three cases in this section and discuss how node is deleted from binary search tree (step (step (step (step case deleting node that has no children look at the binary search tree given in fig if we have to delete node we can simply remove this node without any issue this is the simplest case of deletion figure inserting nodes with values and in the given binary search tree (step (step (step (step case deleting node with one child to handle this casethe node' child is set as the child of the node' parent in other wordsreplace the node with its child nowif the node is the left child of its parentthe node' child becomes the left child of the node' parent correspondinglyif the node is the right child of its parentthe node' child becomes the right child of the node' parent look at the binary search tree shown in fig and see how deletion of node is handled case deleting node with two children to handle this casereplace the node' value figure deleting node from the given binary search tree with its in-order predecessor (largest value in the left sub-treeor in-order successor (step (step (step (step (smallest value in the right sub-treethe in-order predecessor or the successor can then be deleted using any of the above cases look at the binary search tree given in fig and see how deletion of node with value is handled replace with this deletion could also be handled by replacing node with its in-order successoras shown in fig figure deleting node from the given binary search tree nowlet us look at fig which (step (step (step (step shows the algorithm to delete node from binary search tree in step of the algorithmwe first check if tree=nullbecause if it is truethen the node to be deleted is not present in the tree howeverif that is not the casethen we check if the value to be deleted is less than replace node with delete leaf node the current node' data in case the value is lesswe call the algorithm recursively on the figure deleting node from the given binary search tree node' left sub-treeotherwise the algorithm delete node