A simple way of delete a node from binary search tree
with the help of an example
Three possible cases also described in these slides
If any question about these slides then please ask in comments
Size: 1.36 MB
Language: en
Added: Jan 28, 2017
Slides: 10 pages
Slide Content
Deletion
* Deletion is simple if we are deleting a leaf
node
+ Three cases
pd
LeopardROtk
Deletion
+ If the element to be deletedis a leaf node
yo
7
q 1
LeopärdRrök
Deletion
+ If the element to be deleted has one child
\
Deletion
+ If the element to be deleted has one child
@ (3) de
>
14]
ff
LeopärdRöck
Deletion
+ If the element to be deleted has both children
y
)
x
Le
Deletion
+ If the element to be deleted has both children
EN
»
e O \ á
4
LeoparoReck
Code
struct BSTNode* Delete(struct BSTNode *root, int data)