Delete nodes from bst

You are given an array A1 of integers. You have to form first Binary Search tree and then you are provided another array A2. You have to delete each node from the BST which is present in the array A2. Now you have to print preorder traversal of the tree. It is assured that the elements of array A2 will be present in the tree.
Note : In case of node with 2 children, consider its inorder successor as its replacement.

Hello Rupesh,
can u please please explain ,what is your doubt

1 Like

Hello Rupesh,
there was a small bug at line number 124 .you forgot to update root.
https://ide.codingblocks.com/s/171224 now this code works fine.

regards
Aman yadav

1 Like