Skip to content
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

deleteValue not working properly #2

Open
lxb007981 opened this issue Dec 22, 2019 · 1 comment
Open

deleteValue not working properly #2

lxb007981 opened this issue Dec 22, 2019 · 1 comment

Comments

@lxb007981
Copy link

RBTree rbTree1;
rbTree1.insertValue(1);
rbTree1.insertValue(2);
rbTree1.inorder();//output 1, 2
rbTree1.deleteValue(1);
rbTree1.inorder();//output nothing
@mingyuanlee
Copy link

The impl is not correct, here we set the root to null in fixDeleteTree:

if (node == root) {
    root = nullptr;
    return;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants