0001 #include "BST/BST.h" //基于BST实现RedBlack 0002 template <typename T> class RedBlack : public BST<T> { //RedBlack树模板类 0003 protected: 0004 void solveDoubleRed( BinNodePosi<T> x ); //双红修正 0005 void solveDoubleBlack( BinNodePosi<T> x ); //双黑修正 0006 Rank updateHeight( BinNodePosi<T> x ); //更新节点x的高度(重写) 0007 public: 0008 BinNodePosi<T> insert( const T& e ); //插入(重写) 0009 bool remove( const T& e ); //删除(重写) 0010 // BST::search()等其余接口可直接沿用 0011 };