0001 template <typename T> BinNodePosi<T> BinNode<T>::zig() { //˳ʱÕëÐýת 0002 BinNodePosi<T> v = lc; if ( !v ) return this; 0003 v->parent = parent; 0004 if ( v->parent ) 0005 ( ( this == v->parent->rc ) ? v->parent->rc : v->parent->lc ) = v; 0006 lc = v->rc; if ( lc ) lc->parent = this; 0007 v->rc = this; parent = v; 0008 updateHeight(); v->updateHeight(); 0009 return v; 0010 }