static void verify_property_1(node *n) { if (node_color(n) != L_RED_NODE && node_color(n) != L_BLACK_NODE) { L_ERROR("color neither RED nor BLACK\n", "verify_property_1"); return; } if (n == NULL) return; verify_property_1(n->left); verify_property_1(n->right); }
static void verify_properties(L_RBTREE *t) { #if VERIFY_RBTREE verify_property_1(t->root); verify_property_2(t->root); /* Property 3 is implicit */ verify_property_4(t->root); verify_property_5(t->root); #endif }
void verify_properties(rbtree t) { #ifdef VERIFY_RBTREE verify_property_1(t->root); verify_property_2(t->root); /* Property 3 is implicit */ verify_property_4(t->root); verify_property_5(t->root); #endif }
void verify_property_1(node n) { assert(node_color(n) == RED || node_color(n) == BLACK); if (n == NULL) return; verify_property_1(n->left); verify_property_1(n->right); }