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