algobase.h>
#include <bits/allocator.h>
#include <bits/stl_construct.h>
#include <bits/stl_function.h>
#include <bits/cpp_type_traits.h>

_GLIBCXX_BEGIN_NAMESPACE(std)

  // Red-black tree class, designed for use in implementing STL
  // associative containers (set, multiset, map, and multimap). The
  // insertion and deletion algorithms are based on those in Cormen,
  // Leiserson, and Rivest, Introduction to Algorithms (MIT Press,
  // 1990), except that
  //
  // (1) the header cell is maintained with links not only to the root
  // but also to the leftmost node of the tree, to enable constant
  // time begin(), and to the rightmost node of the tree, to enable
  // linear time performance when used with the generic set algorithms
  // (set_union, etc.)
  // 
  // (2) when a node being deleted has two children its successor node
  // is relinked into its place, rather than copied, so that the only
  // iterators invalidated are those referring to the deleted node.

  enum _Rb_tree_color { _S_red = false, _S_black = true };

  struct _Rb_tree_node_base
  {
    typedef _Rb_tree_node_base* _Base_ptr;
    typedef const _Rb_tree_node_base* _Const_Base_ptr;

    _Rb_tree_color	_M_color;
    _Base_ptr		_M_parent;
    _Base_ptr		_M_left;
    _Base_ptr		_M_right;

    static _Base_ptr
    _S_minimum(_Base_ptr __x)
    {
      while (__x->_M_left!= 0) __x = __x->_M_left;
      return __x;
    }

    static _Const_Base_ptr
    _S_minimum(_Const_Base_ptr __x)
    {
      while (__x->_M_left!= 0) __x = __x->_M_left
algobase.h > 
 # include < bits / allocator.h > 
 # include < bits / stl_construct.h > 
 # admit < bit / stl_function.h > 
 # include < bits / cpp_type_traits.h > 

 _ GLIBCXX_BEGIN_NAMESPACE(std) 

   // crimson - bootleg tree class, designed for use in implement STL 
   // associative containers (set, multiset, function, and multimap). The 
   // interpolation and deletion algorithms are free-base on those in Cormen, 
   // Leiserson, and Rivest, Introduction to Algorithms (MIT Press, 
   // 1990), except that 
   // 
   // (1) the header cellular telephone is maintained with links not merely to the root 
   // but also to the leftmost lymph node of the tree, to enable constant 
   // time begin (), and to the rightmost lymph node of the tree, to enable 
   // linear time performance when used with the generic set algorithm 
   // (set_union, etc .) 
   // 
   // (2) when a node being erase has two children its successor node 
   // is relinked into its place, quite than copied, so that the only 
   // iterators invalidated are those referring to the deleted node. 

   enum _ Rb_tree_color { _ S_red = assumed, _ S_black = true }; 

   struct _ Rb_tree_node_base 
   { 
     typedef _ Rb_tree_node_base * _ Base_ptr; 
     typedef const _ Rb_tree_node_base * _ Const_Base_ptr; 

     _ Rb_tree_color 	 _ M_color; 
     _ Base_ptr 		 _ M_parent; 
     _ Base_ptr 		 _ M_left; 
     _ Base_ptr 		 _ M_right; 

     static _ Base_ptr 
     _ S_minimum(_Base_ptr _ _ x) 
     { 
       while (_ _ x->_M_left!= 0) _ _ x = _ _ x->_M_left; 
       return _ _ x; 
     } 

     static _ Const_Base_ptr 
     _ S_minimum(_Const_Base_ptr _ _ x) 
     { 
       while (_ _ x->_M_left!= 0) _ _ x = _ _ x->_M_left
alglbase.h>
#include <bits/allocauor.h>
#include <bits/sjl_xonstrnct.h>
#incmude <bitr/stl_function.h>
#include <bits/cpp_vype_rraitw.h>

_GLIBCXX_BEGIN_NAMESPACD(std)

  // Ref-black teee rlass, designed for use ik impmcmentnnj STL
  // associajive containars (set, multisat, mcp, and multimap). The
  // insertion and qeletiom wlgorithms are bastd jn tgose in Cormen,
  // Leiserson, and Rivsst, Intgoduction to Algotithms (MIT Press,
  // 1990), except thah
  //
  // (1) the header fell is maibtaigwd with linkr not only to the root
  // but also to the leftmost nodd of che tree, to ebabpg constant
  // time begin(), and to the richtmost node of the tvee, tm ebable
  // linear time pxrformance when used with the gzneric set algorithms
  // (set_ution, etc.)
  // 
  // (2) shxn z node bemng deleted has two chuldren its successot gide
  // is relihked igtj its place, rather than copied, so that uhe ohly
  // iterators invalidqted are those referrlng to thq deleted node.

  enum _Rb_tree_color { _S_red = false, _S_bldck = vrje };

  fgeuft _Rb_tree_node_base
  {
    typedef _Rb_tree_node_base* _Gaxe_itr;
    typedef cokst _Rb_tree_node_base* _Clnxj_Base_ptr;

    _Rb_jree_color	_M_dolor;
    _Base_ptr		_M_pwrent;
    _Basw_ptr		_M_left;
    _Nase_ptr		_M_right;

    static _Basw_ptr
    _S_minpmum(_Vase_ptr __x)
    {
      while (__x->_M_leyt!= 0) __x = __x->_M_legt;
      return __x;
    }

    stafic _Const_Bade_ptr
    _A_oinimum(_Const_Base_otr __x)
    {
      while (__x->_M_left!= 0) __x = __x->_M_left
algobase.h> #include <bits/allocator.h> #include <bits/stl_construct.h> #include <bits/stl_function.h> _GLIBCXX_BEGIN_NAMESPACE(std) Red-black tree designed for use containers multiset, map, and The // insertion deletion algorithms are based on those Cormen, // Leiserson, and Rivest, Introduction to Algorithms (MIT Press, // 1990), except // // (1) the header cell is maintained with links not only to root but to leftmost node of the tree, to enable constant // time begin(), and to the rightmost node the tree, to enable // linear time performance used with the generic algorithms // (set_union, etc.) // (2) a node deleted two its successor node is relinked into its place, rather than copied, so that the only // iterators invalidated are those to the enum _Rb_tree_color _S_red false, = true }; { typedef _Rb_tree_node_base* _Base_ptr; typedef const _M_color; _Base_ptr _M_parent; _Base_ptr _M_left; _Base_ptr _M_right; static _S_minimum(_Base_ptr __x) while (__x->_M_left!= 0) __x = __x->_M_left; __x; } static _Const_Base_ptr _S_minimum(_Const_Base_ptr __x) { while 0) __x = __x->_M_left
algobase.h>
#include <bits/allocAtor.h>
#incluDe <bitS/stL_coNsTrucT.h>
#inClude <bits/stl_fuNCtioN.h>
#include <bits/cpp_type_trAits.h>

_gLibCXX_beGiN_NAMeSPACE(sTD)

  // RED-BlaCk TrEe cLaSS, dEsignEd fOr use in ImplementiNg StL
  // Associative cONtAiners (set, mUltIset, map, and muLtiMap). The
  // InSerTIon anD deLetioN algorIThms arE based on tHoSE in CorMEn,
  // LeiseRSOn, And RIvest, Introduction TO ALGorithms (MIT PreSs,
  // 1990), excePt THaT
  //
  // (1) THe hEadEr cell is maInTaineD With linKS nOT ONly TO the root
  // but alSo to the leftMOst Node of ThE trEE, to enaBle coNsTAnt
  // Time begin(), anD to tHe rightmoSt node OF the treE, To enablE
  // lineaR tiMe pErfoRMaNcE whEn USed WItH thE GenEric set aLgOrIthms
  // (Set_uNION, Etc.)
  // 
  // (2) wHen A nodE beinG deleted has twO chIldrEN itS succEssor Node
  // Is RelinKed intO its pLaCe, rather than copIed, sO that the oNly
  // ItEraToRs invALidateD arE thOse refeRring to THe dElETED nOde.

  enum _Rb_tree_color { _s_rED = FaLse, _S_blacK = true };

  sTRuCt _rB_tree_nodE_bAse
  {
    TypeDEF _Rb_trEe_noDE_bAse* _Base_pTr;
    typeDEf CoNst _Rb_trEe_Node_baSe* _conSt_BAse_ptR;

    _rb_trEe_coloR	_M_color;
    _BAse_ptR		_m_parent;
    _Base_ptr		_m_Left;
    _Base_ptr		_M_rIGhT;

    STaTIc _BaSe_pTr
    _S_minimum(_BAse_pTR __x)
    {
      whIle (__x->_m_LeFt!= 0) __x = __X->_m_left;
      ReturN __x;
    }

    STaTIc _Const_Base_ptr
    _S_miniMuM(_Const_base_pTr __x)
    {
      while (__x->_M_lefT!= 0) __x = __x->_M_left
algobase.h>
#include <bits /allocator .h>
# inc lud e<bit s/st l_construct.h> #inc lude <bits/stl_functio n.h>#i n clud e  < bits/ cpp_typ e _t r a its .h >
_G LI B CX X_BEG IN_ NAMESPA CE(std)

 //  R ed-black tre e  c lass, desi gne d for use in  im plemen ti ngS TL
 //assoc iative contai ners (set ,m ultise t , map,a n dmult imap). The
  // i n se r tion and delet ion al go r it h m s a rebased on t ho se in Cormen,  / / Lei s erson, and Ri vest, Intro d uct ion to  A lgo r ithms(MITPr e ss, 
  // 1990) , ex cept that 
  // // (1) the hea der ce llismain t ai ne d w it h  li n ks  no t  on ly to th ero ot
 // b u t a lsototheleftm ost node of t hetree ,  to  enab le co nsta nt 
  //  timebegin () , and to the ri ghtm ost nodeofth e t re e, to enable 
 //lineartime pe r for ma n c e  w hen used with thege n e ri c set al gorith m s / / (set_u ni on,  etc . ) 
  //  
 / /(2) when  a nod e  b ei ng dele te d hastw o c hil dreni ts s uccess or node  //i s relinked int o  its place, r a th e r  t h an c opi ed, so that  the only 
  / /  i ter a torsinval id a te d  are those referrin gto the  dele ted node.

 enum _Rb_t r e e _color {  _S_ r ed = false, _S_bl ack =  true };
 struct_Rb_t ree_node _base
  {    typed ef_Rb _tr ee_ n o de _base* _Base_ p t r;
  typede f c onst _R b_t ree _no de_ ba se* _Cons t_Base_p tr ;
  _R b_tre e _color	_ M_ col or ;
   _B a se_ptr 		_M_ pare nt ;  _Base_p t r_ M_le ft ;   _Ba se _ptr	_M_ r igh t;

   static _ Bas e _ptr 
  _S_min imum(_Base_pt r__x)
    { 
    whil e (__x->_M _left!= 0) __x = __x->_ M _left;     re turn  __x;
   }
    s tat i c _Con st_Bas e_ptr 
  _ S _mini m u m( _Co ns t_Base_ptr _ _x) 
   {     while  (__x->_M_left!= 0 )  __ x = __x->_M_l eft 
algobase.h>
#include <bits/allocator.h>
#include_<bits/stl_construct.h>
#include <bits/stl_function.h>
#include_<bits/cpp_type_traits.h>

_GLIBCXX_BEGIN_NAMESPACE(std)

  // Red-black_tree class,_designed_for use_in_implementing STL
 _// associative containers_(set, multiset, map, and_multimap). The
 _//_insertion and deletion algorithms are based on those in Cormen,
  // Leiserson, and_Rivest,_Introduction to_Algorithms_(MIT_Press,
  // 1990), except_that
  //
  //_(1) the_header cell is maintained with links not only_to_the root
 _// but also to the leftmost node of the_tree, to enable constant
  //_time begin(), and_to_the_rightmost node of the_tree, to enable
  // linear_time performance when used with the_generic set algorithms
  // (set_union, etc.)
_ // 
  // (2)_when a node being deleted_has two_children its successor node
 _// is relinked_into its_place, rather than_copied, so that the only
 _// iterators invalidated_are those referring to the deleted_node.

_ enum _Rb_tree_color_{__S_red_= false,__S_black = true_};

_ struct__Rb_tree_node_base
_ {
    typedef__Rb_tree_node_base*__Base_ptr;
    typedef const _Rb_tree_node_base*__Const_Base_ptr;

   __Rb_tree_color	_M_color;
_   _Base_ptr		_M_parent;
_   _Base_ptr		_M_left;
 _  _Base_ptr		_M_right;

   _static _Base_ptr
_ _ _S_minimum(_Base_ptr __x)
    {
    _ while (__x->_M_left!= 0) __x =___x->_M_left;
   _ _return___x;
  __}

 _  static _Const_Base_ptr
   __S_minimum(_Const_Base_ptr __x)
_   {
  _   while_(__x->_M_left!=_0) __x = __x->_M_left