Instead of using hibbard deletion, I have thought of another possible way.
Let’s say you have some binary tree. If you delete the root node, what is the problem with just making the root of the right subtree become the child of the right of the right most leaf node in the left subtree? Everything on the left subtree of the root should be less than the root, and everything on the right subtree of the root should be greater than the root. The greatest node on the left subtree should be the right most node, so we place the right subtree as this node’s right child, and the properties of the binary search tree should be maintained. What’s wrong with this implementation?
Master Games is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.