Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Stackoverflow in BTreeNode::Balance #9

Open
mvandorp opened this issue Jun 20, 2014 · 0 comments
Open

Stackoverflow in BTreeNode::Balance #9

mvandorp opened this issue Jun 20, 2014 · 0 comments
Assignees
Labels

Comments

@mvandorp
Copy link
Collaborator

When adding the 6th triangle to a tree, the parent->Balance() is recursed endlessly.

void BTreeNode::Balance()
{
    ...
    // if the tree was balanced, there is no need to set any other depths. 
    // This will be done with the recursive Balance() call to the parent nodes.
    //
    // if your parent is not null, balance him out.
    if (this->parent != NULL)
    {
        this->parent->Balance();
    }
}
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants