user1894469
user1894469

Reputation: 143

Exam: deleting a node to a Binary Search Tree

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

Answers (1)

Elliott
Elliott

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

Related Questions