1
votes

My Question is about the case when a deletion such as below occurs. So I am Deleting 68. My book says that whenever a node to be deleted has 2 child nodes, it should be replaced by the left-most child of the right-subtree. In this case, that is 71.

So can someone please explain to me, or refer me to a link that explains how will we manage a deletion like this? If I replace 68 with 71, where does the node 80 go?

Delete 68

1

1 Answers

0
votes

I think I may have found an answer to this. If we bring the right child of 71 in place of 71, then the BST property satisfies with the least number of operations.

If anyone thinks this has a problem or would like to suggest a better solution, please share.