46 static bool redViolation(
const RBNode* p_r,
const RBNode* x);
47 static bool validParents(
const RBNode*
p,
int xID,
const RBNode* x);
48 static bool inOrder(
const RBNode* x,
int lowerBound,
int upperBound);
63 void remove(
int val
TM_ARG);
102 while (child != NULL) {
106 cID = v < cval ? 0 : 1;
121 const RBNode* child_r(child);
175 const RBNode* t(child_rw);
177 parent_w =
const_cast<RBNode*
>(t);
188 if (ochild != NULL) {
221 while (x_r != NULL) {
246 x_rw =
const_cast<RBNode*
>(leftmost_r);
310 sibling_w = nephew_w;
334 if (nephew != NULL) {
396 if (nephew != NULL) {
442 if ((bh0 >= 0) && (bh1 == bh0))
466 && (x_r->
m_ID == xID)
477 return ((lowerBound <= x_r->m_val)
478 && (x_r->
m_val <= upperBound)
495 const RBNode* root_r(root);
500 (
inOrder(root, INT_MIN, INT_MAX)));
RBNode * m_parent
Definition: Tree.hpp:26
#define TM_CALLABLE
Definition: cxxtm.hpp:32
Color m_color
Definition: Tree.hpp:24
TM_CALLABLE bool lookup(int val TM_ARG) const
Definition: Tree.hpp:72
#define TM_WRITE(x, y)
Definition: cxxtm.hpp:46
int m_ID
Definition: Tree.hpp:27
#define TM_ARG
Definition: cxxtm.hpp:40
static bool redViolation(const RBNode *p_r, const RBNode *x)
Definition: Tree.hpp:449
TM_CALLABLE void remove(int val TM_ARG)
Definition: Tree.hpp:214
static bool validParents(const RBNode *p, int xID, const RBNode *x)
Definition: Tree.hpp:460
RBNode * m_child[2]
Definition: Tree.hpp:28
static int blackHeight(const RBNode *x)
Definition: Tree.hpp:435
#define TM_READ(x)
Definition: cxxtm.hpp:45
TM_CALLABLE void modify(int val TM_ARG)
Definition: Tree.hpp:86
RBNode * sentinel
Definition: Tree.hpp:51
TM_CALLABLE void insert(int val TM_ARG)
Definition: Tree.hpp:95
#define TM_PARAM
Definition: cxxtm.hpp:42
int m_val
Definition: Tree.hpp:25
#define TM_ALLOC
Definition: library.hpp:294
bool isSane() const
Definition: Tree.hpp:487
Color
Definition: Tree.hpp:19
RBNode(Color color=BLACK, long val=-1, RBNode *parent=NULL, long ID=0, RBNode *child0=NULL, RBNode *child1=NULL)
Definition: Tree.hpp:31
static bool inOrder(const RBNode *x, int lowerBound, int upperBound)
Definition: Tree.hpp:472
#define TM_FREE
Definition: library.hpp:295
RBTree()
Definition: Tree.hpp:484