void inordertraverse(tree t){ if(!t) return; inordertraverse(t->left); printf("%d\t", t->n); inordertraverse(t->right); }
void inordertraverse(rb_node_t* root) { if(root != &nil) { inordertraverse(root->lchild); printf("%d ",root->key); inordertraverse(root->rchild); } }
int main(void) { nil.color = BLACK; int arr[10] = {2,3,4,1,6,5,7,9,8}; rb_node_t* root1 = rb_create(9,arr); inordertraverse(root1); // printf("%d",root1->lchild->key); printf("\n"); rb_node_t* nodedele = rb_search(root1,4); if(nodedele!=NULL) { root1 = rb_delete(root1,nodedele); } inordertraverse(root1); return EXIT_SUCCESS; }