Binary search tree: Difference between revisions

Content deleted Content added
m Undid revision 1179820761 by WikiLinuz (talk) Sorry, if has then, but while has do.
m Successor and predecessor: if has then, but while has do
Line 92:
'''end if'''
y := x.parent
'''while''' y ≠ NIL '''and''' x = y.right '''thendo'''
x := y
y := y.parent
Line 103:
'''end if'''
y := x.parent
'''while''' y ≠ NIL '''and''' x = y.left '''thendo'''
x := y
y := y.parent
Line 114:
|
BST-Maximum(x)
'''while''' x.right ≠ NIL '''thendo'''
x := x.right
'''repeat'''
Line 120:
|
BST-Minimum(x)
'''while''' x.left ≠ NIL '''thendo'''
x := x.left
'''repeat'''