view paper/src/insertCase2.c @ 71:b0cfef1cd89f

Add sample source
author atton <atton@cr.ie.u-ryukyu.ac.jp>
date Mon, 06 Feb 2017 10:15:16 +0900
parents 5510bb043a74
children
line wrap: on
line source

__code insertCase2(struct Context* context, struct Node* current) {
    struct Node* parent;
    stack_pop(context->node_stack, &parent);

    if (parent->color == Black) {
        stack_pop(context->code_stack, &context->next);
        goto meta(context, context->next);
    }

    stack_push(context->node_stack, &parent);
    goto meta(context, InsertCase3);
}

__code insert2_stub(struct Context* context) {
    goto insertCase2(context, context->data[Tree]->tree.current);
}