示例#1
0
文件: rbtree.c 项目: hgn/ospfd
void insert_case1(struct rbtree* t, struct rbtree_node* n)
{
    if (n->parent == NULL)
        n->color = BLACK;
    else
        insert_case2(t, n);
}
示例#2
0
static inline void
rbtree_add_node_impl(struct RBTREE_TYPENAME* target,
                     struct RBTREE_NODE* N)
{
  DEBUG_RBTREE("rbtree_add_node_impl: "RBTREE_KEY_PRNF"\n",
               RBTREE_KEY_PRN(N->key));
  DEBUG_RBTREE("before:\n");
  // RBTREE_PRINT(target);
  N->color = RED;
  if (target->size == 0)
  {
    target->root = N;
    target->size = 1;
    insert_case1(target, N);
  }
  else
  {
    // Normal tree insertion
    struct RBTREE_NODE* root = target->root;
    rbtree_add_loop(target, N, root);
    insert_case2(target, N);
  }
  DEBUG_RBTREE("after:\n");
  // RBTREE_PRINT(target);
}
示例#3
0
void Bintree:: insert_case1(leaf* n)
{
    if (n->parent == nullptr)
		n->color = col::black;
	else
		insert_case2(n);
}
示例#4
0
static inline void
insert_case1(struct RBTREE_TYPENAME* target, struct RBTREE_NODE* node)
{
  if (node->parent == NULL)
    node->color = BLACK;
  else
    insert_case2(target, node);
}
示例#5
0
/* 
 * ===  FUNCTION  ======================================================================
 *         Name:  insert_case1
 *  Description:  Covers if this is inserting the root
 * =====================================================================================
 */
static void insert_case1 
    ( 
    set * n
    )
{
if(n->parent == NULL)
    {
    n->color = BLACK;
    }
else
    {
    insert_case2(n);
    }
}		/* -----  end of function insert_case1  ----- */
示例#6
0
static void insert_case1(L_RBTREE *t, node *n) {
    if (n->parent == NULL)
        n->color = L_BLACK_NODE;
    else
        insert_case2(t, n);
}
示例#7
0
void insert_case1(rbtree t, node n) {
    if (n->parent == NULL)
        n->color = BLACK;
    else
        insert_case2(t, n);
}
示例#8
0
void insert_case1(GtkWidget *darea, rbtree t, node n) {
  if (n->parent == NULL)
    n->color = BLACK;
  else
    insert_case2(darea, t, n);
}
示例#9
0
文件: rb_tree.c 项目: hvidgaard/AADS
void insert_case1(rb_node* n, rb_tree* tree) {
	if (n->parent == NULL)
		n->color = BLACK;
	else
		insert_case2(n, tree);
}