Reputation: 143
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?
Upvotes: 0
Views: 176
Reputation: 1255
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
Upvotes: 1