-
BST - delete node
One quick qestion, which is probably also silly but anyway, when I deletenig a node in BST which has a right child and it's right child has a left child, does it matter if I swap deleting node with a smallest value from a right subtree or with a greatest value from a left subtree?
Thanks
-
-
>does it matter if I swap deleting node with a smallest value from a right subtree or with a greatest value from a left subtree?
In theory, you should alternate between them because focusing on one subtree can cause an imbalance. However, in practice you're extremely unlikely to see that case with an unbalanced tree, so it doesn't matter.
-
I will stick to practice :)
btw - nice tutorial on C++ World
-
>btw - nice tutorial on C++ World
Eew, you're still reading those old ones? I've updated several times since those were written, and you can find the latest at http://eternallyconfuzzled.com/brain.html.
-
Wow your tutorials are great :cool:
keep on the good work