mirror of
https://gitee.com/apaki/unicstl.git
synced 2025-07-03 15:56:52 +08:00
添加出错说明
This commit is contained in:
parent
68706331a1
commit
71ba5642ae
@ -132,16 +132,20 @@ static bool tree_rb_check_color(struct _tree *self, struct _tree_node* root, int
|
|||||||
{
|
{
|
||||||
if(black_num != black_num_expected)
|
if(black_num != black_num_expected)
|
||||||
{
|
{
|
||||||
|
printf("black_num != black_num_expected\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(root->color == RBT_BLACK)
|
if(root->color == RBT_BLACK)
|
||||||
{
|
{
|
||||||
black_num++;
|
black_num++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(root->color == RBT_RED && root->parent && root->parent->color == RBT_RED)
|
if(root->color == RBT_RED && root->parent && root->parent->color == RBT_RED)
|
||||||
{
|
{
|
||||||
|
printf("The red node is adjacent to the red node\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return tree_rb_check_color(self, root->left, black_num, black_num_expected) &&
|
return tree_rb_check_color(self, root->left, black_num, black_num_expected) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user