successor
to null
.null
.p
is greater than or equal to the current node's value, move to the right child of the current node.p
is less than the current node's value, update successor
to the current node and move to the left child.null
.successor
.