0001 #define IsBlack(p) ( ! (p) || ( RB_BLACK == (p)->color ) ) //外部节点也视作黑节点 0002 #define IsRed(p) ( ! IsBlack(p) ) //非黑即红 0003 #define BlackHeightUpdated(x) ( /*RedBlack高度更新条件*/ \ 0004 ( stature( (x)->lc ) == stature( (x)->rc ) ) && \ 0005 ( (x)->height == ( IsRed(x) ? stature( (x)->lc ) : stature( (x)->lc ) + 1 ) ) \ 0006 )