651 if (_Where->container() !=
this)
652 throw gcnew System::InvalidOperationException();
654 if (_Node->_Left->is_head())
655 _Fixnode = _Node->_Right;
656 else if (_Node->_Right->is_head())
657 _Fixnode = _Node->_Left;
661 _Fixnode = _Node->_Right;
666 _Fixnodeparent = _Where->_Parent;
667 if (!_Fixnode->is_head())
668 _Fixnode->_Parent = _Fixnodeparent;
672 else if (_Fixnodeparent->_Left == _Where)
673 _Fixnodeparent->
_Left = _Fixnode;
675 _Fixnodeparent->_Right = _Fixnode;
680 : _Fixnode->min_node();
685 : _Fixnode->max_node();
689 _Where->
_Left->_Parent = _Node;
690 _Node->_Left = _Where->_Left;
692 if (_Node == _Where->_Right)
693 _Fixnodeparent = _Node;
696 _Fixnodeparent = _Node->_Parent;
697 if (!_Fixnode->is_head())
698 _Fixnode->_Parent = _Fixnodeparent;
699 _Fixnodeparent->_Left = _Fixnode;
700 _Node->_Right = _Where->_Right;
701 _Where->_Right->_Parent = _Node;
706 else if (_Where->_Parent->_Left == _Where)
707 _Where->
_Parent->_Left = _Node;
709 _Where->_Parent->_Right = _Node;
711 _Node->_Parent = _Where->_Parent;
713 signed char _Color = _Node->_Color;
715 _Node->_Color = _Where->_Color;
719 if (_Where->_Color ==
_Black)
722 _Fixnodeparent = _Fixnode->_Parent)
723 if (_Fixnode == _Fixnodeparent->_Left)
725 _Node = _Fixnodeparent->_Right;
726 if (_Node->_Color ==
_Red)
729 _Fixnodeparent->_Color =
_Red;
731 _Node = _Fixnodeparent->_Right;
734 if (_Node->is_head())
735 _Fixnode = _Fixnodeparent;
736 else if (_Node->_Left->_Color ==
_Black
737 && _Node->_Right->_Color ==
_Black)
739 _Node->_Color =
_Red;
740 _Fixnode = _Fixnodeparent;
744 if (_Node->_Right->_Color ==
_Black)
746 _Node->_Left->_Color =
_Black;
747 _Node->_Color =
_Red;
749 _Node = _Fixnodeparent->_Right;
752 _Node->_Color = _Fixnodeparent->_Color;
753 _Fixnodeparent->_Color =
_Black;
754 _Node->_Right->_Color =
_Black;
761 _Node = _Fixnodeparent->_Left;
762 if (_Node->_Color ==
_Red)
765 _Fixnodeparent->_Color =
_Red;
767 _Node = _Fixnodeparent->_Left;
769 if (_Node->is_head())
770 _Fixnode = _Fixnodeparent;
771 else if (_Node->_Right->_Color ==
_Black
772 && _Node->_Left->_Color ==
_Black)
774 _Node->_Color =
_Red;
775 _Fixnode = _Fixnodeparent;
779 if (_Node->_Left->_Color ==
_Black)
781 _Node->_Right->_Color =
_Black;
782 _Node->_Color =
_Red;
784 _Node = _Fixnodeparent->_Left;
787 _Node->_Color = _Fixnodeparent->_Color;
788 _Fixnodeparent->_Color =
_Black;
789 _Node->_Left->_Color =
_Black;
795 _Fixnode->_Color =
_Black;
798 _Mybase_t::unmake_value(_Where->_Myval);
799 _Where->_Head =
nullptr;
unsigned long _Mygen
Definition: xtree:1114
_Mytype_t _Right
Definition: xtree:129
signed char _Color
Definition: xtree:131
tree_node< _Key_t, _Value_t > node_type
Definition: xtree:192
node_type back_node()
Definition: xtree:302
_Node _Left
Definition: xtree:905
node_type head_node()
Definition: xtree:312
node_type front_node()
Definition: xtree:297
void _Lrotate(node_type^_Where)
Definition: xtree:1071
_Node _Color
Definition: xtree:909
_Mytype_t _Parent
Definition: xtree:128
_Mytype_t _Left
Definition: xtree:127
node_type root_node()
Definition: xtree:307
_Node _Parent
Definition: xtree:906
void _Rrotate(node_type^_Where)
Definition: xtree:1091
static const int _Red
Definition: xtree:235
if(__pUnknown!=*__ppTargetUnknown)
Definition: vccorlib.h:399
static const int _Black
Definition: xtree:234
size_type _Mysize
Definition: xtree:1113