0

when removing a node with two children, and if instructed to use the standard binary search tree node removal algorithm, should we replace it with the smallest node of the right subtree or the largest node of the left subtree?

1 Answer 1

1

Replace it with the largest node in the left subtree :)

Source that's as good as any: http://webdocs.cs.ualberta.ca/~holte/T26/del-from-bst.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.