-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working insert / delete case #1
Comments
Did you by any chance find the root cause ? :)
…On Fri, 12 Jul 2019 at 09:00, Alexander ***@***.***> wrote:
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;
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1?email_source=notifications&email_token=ACZWUSSASVNUZPWD6DXKPQTP7AT2TA5CNFSM4ICDGTO2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G6ZXQXQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACZWUSQQNZOUP2SL32J4KY3P7AT2TANCNFSM4ICDGTOQ>
.
--
Thanks and Regards.
Ananda Rao H
|
Yes, and I think the main reason is appearance of DOUBLE_BLACK color in the nodes. You can easily repeat this case in Windows system (my be in Linux too) because RAND function creates the same sequence. |
Can you send a pull request if you have a fix ? :) I've lost touch of this repo. |
Sorry, I do not want to look for an error =) |
I am fixed it. |
In this case I get an error:
if Z equal 699 deletion fails with segfoult in the flowing
The text was updated successfully, but these errors were encountered: