|
@@ -18,6 +18,9 @@ void debug_print_tree(int indent, void *p) {
|
18
|
18
|
TreeAlloc *node = (TreeAlloc*) p;
|
19
|
19
|
if (node != NULL) {
|
20
|
20
|
int bad = debug_tree_black_height(node->left) != debug_tree_black_height(node->right);
|
|
21
|
+ bad |= node->color == COLOR_RED && ((node->left != NULL && node->left->color == COLOR_RED) ||
|
|
22
|
+ (node->right != NULL && node->right->color == COLOR_RED) || (node->parent != NULL &&
|
|
23
|
+ node->parent->color == COLOR_RED));
|
21
|
24
|
debug_print_tree(indent + 1, node->left);
|
22
|
25
|
for (int ii = 0; ii < indent; ii++) { printf(" "); }
|
23
|
26
|
if (node->color == COLOR_RED) { printf("\e[31m"); }
|