8000 Not working insert / delete case · Issue #1 · anandarao/Red-Black-Tree · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Not working insert / delete case #1
Open
@ALEXks

Description

@ALEXks

In this case I get an error:

for (int z = 0; z < 30000; ++z)
    {
        printf(" Z = %d\n", z);
        if (z == 699)
            printf("");
        data = rand() % 5000 + 220;
        rbTree1.insertValue(data);
        q.push(data);
        rbTree1.preorder();

        if (q.size() >= 15)
        {
            rbTree1.deleteValue(q.front());            
            q.pop();
        }
    }

if Z equal 699 deletion fails with segfoult in the flowing

int RBTree::getColor(Node*& node) 
{
    if (node == NULL)
        return BLACK;

    return node->color;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0