// successor is the next in-order node in the tree
successor is the next in-order node in the tree
// successor is the next in - order node in the tree
func (x *intervalNode) successor(nilNode *intervalNode) *intervalNode {
	if x.right != nilNode {
		return x.right.min(nilNode)
	}
	y := x.parent
	for y != nilNode && x == y.right {
		x = y
		y = y.parent
	}
	return y
}
func ( x * intervalNode ) successor ( nilNode * intervalNode ) * intervalNode { if x . right != nilNode { return x . right . min ( nilNode ) } y := x . parent for y != nilNode && x == y . right { x = y y = y . parent } return y }
successor is the next in-order node in the tree
successor is the next in - order node in the tree