InfinityUtils/RedBlackTree.h
Node* predecessor(Node* x) {
		// if the left subtree is not null,
		// the predecessor is the rightmost node in the 
		// left subtree
		if (x->left != TNULL) {
			return maximum(x->left);
		}

		Node* y = x->parent;
		while (y != TNULL && x == y->left) {
			x = y;
			y = y->parent;
		}

		return y;
	}
// find the predecessor of a given node

find the predecessor of a given node
find the predecessor of a given node
Node* predecessor(Node* x) {
		if (x->left != TNULL) {
			return maximum(x->left);
		}
		Node* y = x->parent;
		while (y != TNULL && x == y->left) {
			x = y;
			y = y->parent;
		}
		return y;
	}
Node * predecessor ( Node * x ) { if ( x -> left != TNULL ) { return maximum ( x -> left ) ; } Node * y = x -> parent ; while ( y != TNULL && x == y -> left ) { x = y ; y = y -> parent ; } return y ; }
find the predecessor of a given node
find the predecessor of a given node
// if the left subtree is not null,
 // the predecessor is the rightmost node in the 
 // left subtree
