Binary search tree: Difference between revisions

Content deleted Content added
Deletion: More precise successor definition.
Line 154:
 
===Deletion===
[[File:BST node deletion.png|thumb|400px|right|The node <math>\text{D}</math> to be deleted has 2 children]]
The deletion of a node, say <math>\text{Z}</math>, from the binary search tree <math>\text{BST}</math> has three cases:{{r|algo_cormen|p=295-297}}
# If <math>\text{Z}</math> is a leaf node, it is replaced by <math>\text{NIL}</math> as shown in (a).