Binary Search Tree: Deletion Overview

preview_player
Показать описание
Learn how we can go about, deleting nodes within our Binary Search Tree. There are 3 cases we should consider when deleting a node within our Binary Search Tree. Case 1 is how do we go about deleting a node with no children. Case 2 is how do we go about deleting an node with one child. Case 3 is how do we go about deleting an node with 2 children.
Рекомендации по теме
Комментарии
Автор

Thanks for the clear and quick explanation! I was struggling to figure out how to do it deleting the root node and this was the one video simple enough that I could understand

JewelWildmoon
Автор

Straight to the point, simple, and clear. Thank you!

servantofthelord
Автор

For clearity, in the case of deleting with 2 children. In the first way we find "inorder successor", and in the second way we find "inorder predecessor"

BoMpOwMsp
Автор

Short but helpful video. Thank you very much.

Aji-djzm
Автор

It doesn't get any clearer or more concise, thanks for this.

gxurhmw
Автор

Clear and concise, just what is needed! Thanks a lot.

marvhartigan
Автор

What if you were deleting 100 from the BST, but neither the key 95, nor the key 110 were in the tree, your successor is 115 (which now has a left-child node of 120) and you predecessor is now 85 (but it has a left-child node of 80). What happens to these child nodes when you replace 100 with either 115 or 85? I imagine you have to move their pointers?

gerardforster
Автор

You are wrong on the third case: replacing the node value to be deleted with the smallest node on the right tree not necessarily be the leaf node always. It could be a node with one child that is a right child.

Killswitch
Автор

thank you a lot for your understandable explaination

ZNhatAnhZ
Автор

Thanks for the knowledge shared.Bless you

myazpiration
visit shbcf.ru